Skip to content

Commit

Permalink
Merge branch 'lucide-icons:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanHazel authored Oct 9, 2024
2 parents bd96615 + bde9e1c commit 2affdf5
Show file tree
Hide file tree
Showing 33 changed files with 727 additions and 146 deletions.
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
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
8 changes: 4 additions & 4 deletions icons/component.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions icons/eye-closed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "../icon.schema.json",
"contributors": [
"karsa-mistmere"
],
"tags": [
"view",
"watch",
"see",
"hide",
"conceal",
"mask",
"hidden",
"visibility",
"vision"
],
"categories": [
"accessibility",
"photography",
"design",
"security"
]
}
17 changes: 17 additions & 0 deletions icons/eye-closed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 9 additions & 2 deletions icons/eye-off.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,18 @@
"tags": [
"view",
"watch",
"see",
"hide",
"hidden"
"conceal",
"mask",
"hidden",
"visibility",
"vision"
],
"categories": [
"accessibility",
"photography"
"photography",
"design",
"security"
]
}
16 changes: 14 additions & 2 deletions icons/eye.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,22 @@
],
"tags": [
"view",
"watch"
"watch",
"see",
"show",
"expose",
"reveal",
"display",
"visible",
"visibility",
"vision",
"preview",
"read"
],
"categories": [
"accessibility",
"photography"
"photography",
"design",
"security"
]
}
6 changes: 3 additions & 3 deletions icons/move-diagonal-2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions icons/move-diagonal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions icons/move-horizontal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions icons/move-vertical.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions icons/move.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"csandman",
"ericfennis",
"karsa-mistmere",
"danielbayley"
"danielbayley",
"jguddas"
],
"tags": [
"box",
Expand Down
6 changes: 3 additions & 3 deletions icons/package.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion icons/parking-meter.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"$schema": "../icon.schema.json",
"contributors": [
"danielbayley"
"danielbayley",
"jguddas"
],
"tags": [
"driving",
Expand Down
6 changes: 3 additions & 3 deletions icons/parking-meter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion icons/sandwich.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"$schema": "../icon.schema.json",
"contributors": [
"kemie"
"kemie",
"jamiemlaw"
],
"tags": [
"food",
Expand Down
Loading

0 comments on commit 2affdf5

Please sign in to comment.