Skip to content

Commit

Permalink
Merge branch 'main' into megaphone
Browse files Browse the repository at this point in the history
  • Loading branch information
ericfennis authored Nov 4, 2024
2 parents 76ab9a2 + 11b95f8 commit c473340
Show file tree
Hide file tree
Showing 92 changed files with 3,467 additions and 3,227 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/close-issue-with-banned-phrases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Close Issue with Banned Phrases

on:
issues:
types: [opened]

jobs:
block_phrases:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Check for blocked phrases in issue title
run: |
ISSUE_TITLE=$(jq -r '.issue.title' "$GITHUB_EVENT_PATH")
BLOCKED_PHRASES=("twitter" "whatsapp" "logo" "google" "tiktok" "facebook" "slack" "discord")
# Check title and body for blocked phrases
for PHRASE in "${BLOCKED_PHRASES[@]}"
do
if echo "$ISSUE_TITLE" | grep -i "$PHRASE"; then
gh issue close ${{ github.event.issue.number }} --reason "not planned" --comment "This looks like a duplicate, use the [search](https://github.com/lucide-icons/lucide/issues?q=is%3Aissue+$PHRASE) to find similar issues.
Read more about brand guideline rules at [We're not accepting new Brand icons #670](https://github.com/lucide-icons/lucide/issues/670).
Always happy to help on [Discord](https://discord.gg/EH6nSts)."
gh issue lock ${{ github.event.issue.number }} --reason spam
exit 1
fi
done
env:
GH_TOKEN: ${{ github.token }}
1 change: 1 addition & 0 deletions .github/workflows/lucide-preact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
paths:
- packages/lucide-preact/**
- packages/shared/**
- tools/build-icons/**
- tools/rollup-plugins/**
- pnpm-lock.yaml
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lucide-react-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
paths:
- packages/lucide-react-native/**
- packages/shared/**
- tools/build-icons/**
- tools/rollup-plugins/**
- pnpm-lock.yaml
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lucide-react.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
paths:
- packages/lucide-react/**
- packages/shared/**
- tools/build-icons/**
- tools/rollup-plugins/**
- scripts/generateNextJSAliases.mjs
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/lucide-shared.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Lucide Shared Checks

on:
pull_request:
paths:
- packages/shared/**
- pnpm-lock.yaml

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/[email protected]
with:
node-version: 18
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Test
run: pnpm --filter lucide-react test
1 change: 1 addition & 0 deletions .github/workflows/lucide-solid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
paths:
- packages/lucide-solid/**
- packages/shared/**
- tools/build-icons/**
- tools/rollup-plugins/**
- pnpm-lock.yaml
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lucide-svelte.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
paths:
- packages/lucide-svelte/**
- packages/shared/**
- tools/build-icons/**
- tools/rollup-plugins/**
- pnpm-lock.yaml
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lucide-vue-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
paths:
- packages/lucide-vue-next/**
- packages/shared/**
- tools/build-icons/**
- tools/rollup-plugins/**
- pnpm-lock.yaml
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lucide-vue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
paths:
- packages/lucide-vue/**
- packages/shared/**
- tools/build-icons/**
- tools/rollup-plugins/**
- pnpm-lock.yaml
Expand Down
2 changes: 1 addition & 1 deletion categories/charts.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "../category.schema.json",
"title": "Charts",
"icon": "pie-chart"
"icon": "chart-pie"
}
19 changes: 19 additions & 0 deletions docs/.vitepress/data/packageData.thirdParty.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,24 @@
],
"source": "https://github.com/swisnl/nuxt-lucide-icons",
"documentation": "https://github.com/swisnl/nuxt-lucide-icons/blob/main/README.md"
},
{
"name": "lucide-lustre",
"description": "A library providing https://lucide.dev icons to lustre",
"icon": "/framework-logos/lustre.webp",
"shields": [
{
"alt": "Latest Stable Version",
"src": "https://img.shields.io/hexpm/v/lucide_lustre",
"href": "https://hex.pm/packages/lucide_lustre"
},
{
"alt": "Total Downloads",
"src": "https://img.shields.io/hexpm/dw/lucide_lustre",
"href": "https://hex.pm/packages/lucide_lustre"
}
],
"source": "https://github.com/dinkelspiel/lucide_lustre",
"documentation": "https://github.com/dinkelspiel/lucide_lustre/blob/master/README.md"
}
]
2 changes: 1 addition & 1 deletion docs/.vitepress/data/teamData.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
{
"icon": "x",
"link": "https://github.com/ericfennis"
"link": "https://x.com/ericfennis"
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/theme/components/base/Tooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ onMounted(() => {
font-weight: 400;
background: var(--vp-c-brand-dark);
color: white;
z-index: 10;
z-index: 99;
white-space: nowrap;
padding: 2px 8px;
border-radius: 4px;
Expand Down
76 changes: 38 additions & 38 deletions docs/.vitepress/theme/components/icons/CopyCodeButton.vue
Original file line number Diff line number Diff line change
@@ -1,98 +1,98 @@
<script setup lang="ts">
import { computed } from 'vue';
import { startCase, camelCase } from 'lodash-es'
import ButtonMenu from '../base/ButtonMenu.vue'
import { toPascalCase } from '@lucide/shared';
import ButtonMenu from '../base/ButtonMenu.vue';
import { useIconStyleContext } from '../../composables/useIconStyle';
import useConfetti from '../../composables/useConfetti';
const props = defineProps<{
name: string
popoverPosition?: 'top' | 'bottom'
}>()
const { size, color, strokeWidth, absoluteStrokeWidth } = useIconStyleContext()
const { animate, confetti } = useConfetti()
name: string;
popoverPosition?: 'top' | 'bottom';
}>();
const { size, color, strokeWidth, absoluteStrokeWidth } = useIconStyleContext();
const { animate, confetti } = useConfetti();
const componentName = computed(() => {
return startCase(camelCase(props.name)).replace(/\s/g, '')
})
return (toPascalCase(props.name) as string).replace(/\s/g, '');
});
function copyJSX() {
let attrs = ['']
let attrs = [''];
if (size.value && size.value !== 24) {
attrs.push(`size={${size.value}}`)
attrs.push(`size={${size.value}}`);
}
if (color.value && color.value !== 'currentColor') {
attrs.push(`color="${color.value}"`)
attrs.push(`color="${color.value}"`);
}
if (strokeWidth.value && strokeWidth.value !== 2) {
attrs.push(`strokeWidth={${strokeWidth.value}}`)
attrs.push(`strokeWidth={${strokeWidth.value}}`);
}
if (absoluteStrokeWidth.value) {
attrs.push(`absoluteStrokeWidth`)
attrs.push(`absoluteStrokeWidth`);
}
const code = `<${componentName.value}${attrs.join(' ')} />`
const code = `<${componentName.value}${attrs.join(' ')} />`;
navigator.clipboard.writeText(code)
navigator.clipboard.writeText(code);
}
function copyComponentName() {
const code = componentName.value
const code = componentName.value;
navigator.clipboard.writeText(code)
navigator.clipboard.writeText(code);
}
function copyVue() {
let attrs = ['']
let attrs = [''];
if (size.value && size.value !== 24) {
attrs.push(`:size="${size.value}"`)
attrs.push(`:size="${size.value}"`);
}
if (color.value && color.value !== 'currentColor') {
attrs.push(`color="${color.value}"`)
attrs.push(`color="${color.value}"`);
}
if (strokeWidth.value && strokeWidth.value !== 2) {
attrs.push(`:stroke-width="${strokeWidth.value}"`)
attrs.push(`:stroke-width="${strokeWidth.value}"`);
}
if (absoluteStrokeWidth.value) {
attrs.push(`absoluteStrokeWidth`)
attrs.push(`absoluteStrokeWidth`);
}
const code = `<${componentName.value}${attrs.join(' ')} />`
const code = `<${componentName.value}${attrs.join(' ')} />`;
navigator.clipboard.writeText(code)
navigator.clipboard.writeText(code);
}
function copyAngular() {
let attrs = ['']
let attrs = [''];
attrs.push(`name="${props.name}"`)
attrs.push(`name="${props.name}"`);
if (size.value && size.value !== 24) {
attrs.push(`[size]="${size.value}"`)
attrs.push(`[size]="${size.value}"`);
}
if (color.value && color.value !== 'currentColor') {
attrs.push(`color="${color.value}"`)
attrs.push(`color="${color.value}"`);
}
if (strokeWidth.value && strokeWidth.value !== 2) {
attrs.push(`[strokeWidth]="${strokeWidth.value}"`)
attrs.push(`[strokeWidth]="${strokeWidth.value}"`);
}
if (absoluteStrokeWidth.value) {
attrs.push(`[absoluteStrokeWidth]="true"`)
attrs.push(`[absoluteStrokeWidth]="true"`);
}
const code = `<lucide-icon${attrs.join(' ')}></lucide-icon>`
const code = `<lucide-icon${attrs.join(' ')}></lucide-icon>`;
navigator.clipboard.writeText(code)
navigator.clipboard.writeText(code);
}
</script>

Expand All @@ -106,11 +106,11 @@ function copyAngular() {
data-confetti-text="Copied!"
:popoverPosition="popoverPosition"
:options="[
{ text: 'Copy JSX' , onClick: copyJSX },
{ text: 'Copy Component Name' , onClick: copyComponentName },
{ text: 'Copy Vue' , onClick: copyVue },
{ text: 'Copy Svelte' , onClick: copyJSX },
{ text: 'Copy Angular' , onClick: copyAngular },
{ text: 'Copy JSX', onClick: copyJSX },
{ text: 'Copy Component Name', onClick: copyComponentName },
{ text: 'Copy Vue', onClick: copyVue },
{ text: 'Copy Svelte', onClick: copyJSX },
{ text: 'Copy Angular', onClick: copyAngular },
]"
/>
</template>
Expand Down
6 changes: 3 additions & 3 deletions docs/guide/design/icon-design-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Here are rules that should be followed to keep quality and consistency when maki

![optical-volume-high](../../images/optical-volume-high.svg?raw=true "optical-volume-high")

**Tip:** place your icon next to circle or square and blur them both; your icon should not feel much darker than the base shape.
**Tip:** place your icon next to the circle or square icon and blur them both; your icon should not feel much darker than the base shape.

### 10. Icons should be visually centered by their center of gravity.

Expand All @@ -76,7 +76,7 @@ Here are rules that should be followed to keep quality and consistency when maki

![curvature-uneven](../../images/curvature-uneven.svg?raw=true "curvature-uneven")

**Tip:** make sure to use arcs or quadratic curves, when using cubic curves control points should have mirrored angles for smooth curves.
**Tip:** make sure to use arcs or quadratic curves. When using cubic curves control points should have mirrored angles for smooth curves.

### 13. Icons should aim to be pixel perfect so that they will be sharp on low DPI displays.

Expand Down Expand Up @@ -142,7 +142,7 @@ For each icon these attributes are applied, corresponding to the above rules.
### Minify paths

The code of paths can sometimes get quite large. To reduce file size we like to minify the code.
We recommend to use the [SVGOMG](https://jakearchibald.github.io/svgomg/) to minify paths to 2 points of precision.
We recommend to use [SVGOMG](https://jakearchibald.github.io/svgomg/) to minify paths to 2 points of precision.

### Allowed elements

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ However, not everyone can understand them easily. Read more about [how to use Lu

## Official Packages

Lucide's official packages are designed to work on different platforms, making it easier for users to integrate icons into their projects. The packages are available for various technologies, including [Web (Vanilla)](https://lucide.dev/guide/packages/lucide), [React](https://lucide.dev/guide/packages/lucide-react), [React Native](https://lucide.dev/guide/packages/lucide-react-native), [Vue](https://lucide.dev/guide/packages/lucide-vue), [Vue 3](https://lucide.dev/guide/packages/lucide-vue-next), [Svelte](https://lucide.dev/guide/packages/lucide-svelte),[Preact](https://lucide.dev/guide/packages/lucide-preact), [Solid](https://lucide.dev/guide/packages/lucide-solid), [Angular](https://lucide.dev/guide/packages/lucide-angular), [NodeJS](https://lucide.dev/guide/packages/lucide-static#nodejs) and [Flutter](https://lucide.dev/guide/packages/lucide-flutter).
Lucide's official packages are designed to work on different platforms, making it easier for users to integrate icons into their projects. The packages are available for various technologies, including [Web (Vanilla)](https://lucide.dev/guide/packages/lucide), [React](https://lucide.dev/guide/packages/lucide-react), [React Native](https://lucide.dev/guide/packages/lucide-react-native), [Vue](https://lucide.dev/guide/packages/lucide-vue), [Vue 3](https://lucide.dev/guide/packages/lucide-vue-next), [Svelte](https://lucide.dev/guide/packages/lucide-svelte), [Preact](https://lucide.dev/guide/packages/lucide-preact), [Solid](https://lucide.dev/guide/packages/lucide-solid), [Angular](https://lucide.dev/guide/packages/lucide-angular), [NodeJS](https://lucide.dev/guide/packages/lucide-static#nodejs) and [Flutter](https://lucide.dev/guide/packages/lucide-flutter).

## Community
If you have any questions about Lucide, feel free to reach out to the community. You can find them on [GitHub](https://github.com/lucide-icons/lucide) and [Discord](https://discord.gg/EH6nSts).
13 changes: 8 additions & 5 deletions docs/guide/packages/lucide-angular.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,17 @@ export class AppModule { }
or using standalone version:

```js
import { Component } from '@angular/core';
import { LucideAngularModule, FileIcon } from 'lucide-angular';

@NgModule({
imports: [
LucideAngularModule
]
@Component({
standalone: true,
selector: 'app-root',
templateUrl: './app.component.html',
styleUrl: './app.component.scss',
imports: [LucideAngularModule]
})
export class AppModule {
export class AppComponent {
readonly FileIcon = FileIcon;
}
```
Expand Down
7 changes: 3 additions & 4 deletions docs/icons/[name].md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ import RelatedIcons from '~/.vitepress/theme/components/icons/RelatedIcons.vue'
import CodeGroup from '~/.vitepress/theme/components/base/CodeGroup.vue'
import Badge from '~/.vitepress/theme/components/base/Badge.vue'
import Label from '~/.vitepress/theme/components/base/Label.vue'
import VPButton from 'vitepress/dist/client/theme-default/components/VPButton.vue';
import { data } from './codeExamples.data'
import { camelCase, startCase } from 'lodash-es'
import { toCamelCase, toPascalCase } from '@lucide/shared'
import { satisfies } from 'semver'

const { params } = useData()
Expand All @@ -31,8 +30,8 @@ const tabs = computed(() => data.codeExamples?.map(

const codeExample = computed(() => data.codeExamples?.map(
(codeExample) => {
const pascalCaseName = startCase(camelCase( params.value.name)).replace(/\s/g, '')
const camelCaseName = camelCase(params.value.name)
const pascalCaseName = toPascalCase( params.value.name)
const camelCaseName = toCamelCase(params.value.name)

return codeExample.code
.replace(/\$(?:<[^>]+>)*PascalCase/g, pascalCaseName)
Expand Down
Loading

0 comments on commit c473340

Please sign in to comment.