@santi020k/lumen-astro 0.4.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -6
- package/components/Accordion.astro +4 -4
- package/components/Affix.astro +2 -2
- package/components/Agenda.astro +3 -2
- package/components/Alert.astro +9 -9
- package/components/AlertDialog.astro +7 -13
- package/components/Anchor.astro +18 -4
- package/components/AnimatedLogo.astro +2 -1
- package/components/AnimatedNumber.astro +5 -2
- package/components/AnimatedPortrait.astro +46 -36
- package/components/AspectRatio.astro +10 -8
- package/components/Attachment.astro +24 -24
- package/components/Autocomplete.astro +3 -2
- package/components/Avatar.astro +4 -3
- package/components/BackToTop.astro +2 -2
- package/components/Badge.astro +9 -9
- package/components/BarChart.astro +76 -50
- package/components/Breadcrumb.astro +3 -3
- package/components/Bubble.astro +7 -7
- package/components/Button.astro +18 -16
- package/components/ButtonGroup.astro +3 -3
- package/components/ButtonLink.astro +9 -3
- package/components/Calendar.astro +43 -31
- package/components/Callout.astro +2 -2
- package/components/Card.astro +12 -10
- package/components/CardContent.astro +26 -0
- package/components/CardDescription.astro +26 -0
- package/components/CardFooter.astro +26 -0
- package/components/CardHeader.astro +26 -0
- package/components/CardTitle.astro +26 -0
- package/components/Carousel.astro +6 -6
- package/components/Cascader.astro +10 -4
- package/components/Chart.astro +9 -6
- package/components/Checkbox.astro +3 -2
- package/components/CheckboxGroup.astro +39 -0
- package/components/Code.astro +55 -52
- package/components/CodeTabs.astro +6 -6
- package/components/Collapsible.astro +3 -3
- package/components/ColorPicker.astro +3 -2
- package/components/Combobox.astro +4 -5
- package/components/Command.astro +6 -6
- package/components/Container.astro +29 -0
- package/components/ContextMenu.astro +7 -13
- package/components/CopyButton.astro +55 -0
- package/components/CoverImage.astro +19 -9
- package/components/DataTable.astro +50 -49
- package/components/DatePicker.astro +20 -17
- package/components/DateRangePicker.astro +3 -2
- package/components/Descriptions.astro +3 -3
- package/components/Dialog.astro +8 -14
- package/components/Direction.astro +3 -3
- package/components/Drawer.astro +7 -13
- package/components/DropdownMenu.astro +7 -13
- package/components/Empty.astro +6 -6
- package/components/ErrorSummary.astro +54 -0
- package/components/Eyebrow.astro +2 -2
- package/components/Field.astro +7 -6
- package/components/FieldError.astro +29 -0
- package/components/FileUpload.astro +2 -2
- package/components/FloatingBadge.astro +2 -2
- package/components/Form.astro +33 -0
- package/components/FormattedDate.astro +2 -2
- package/components/GradientDivider.astro +2 -2
- package/components/Grid.astro +46 -0
- package/components/HoverCard.astro +7 -13
- package/components/Icon.astro +8 -6
- package/components/Image.astro +2 -1
- package/components/Input.astro +21 -7
- package/components/InputGroup.astro +3 -3
- package/components/InputOTP.astro +5 -3
- package/components/Item.astro +11 -8
- package/components/Kbd.astro +3 -3
- package/components/Label.astro +3 -2
- package/components/LanguageToggle.astro +2 -2
- package/components/LineChart.astro +52 -35
- package/components/Link.astro +6 -5
- package/components/ListBox.astro +154 -0
- package/components/Marker.astro +6 -6
- package/components/Mentions.astro +30 -10
- package/components/Menubar.astro +7 -13
- package/components/Message.astro +5 -5
- package/components/MessageScroller.astro +6 -6
- package/components/Meter.astro +1 -0
- package/components/NativeSelect.astro +21 -9
- package/components/NavigationMenu.astro +9 -14
- package/components/Note.astro +1 -1
- package/components/NumberField.astro +3 -2
- package/components/Pagination.astro +3 -3
- package/components/Particles.astro +13 -3
- package/components/PasswordField.astro +73 -0
- package/components/PhoneInput.astro +5 -7
- package/components/PieChart.astro +16 -13
- package/components/Pill.astro +11 -8
- package/components/Popconfirm.astro +8 -3
- package/components/Popover.astro +7 -13
- package/components/Progress.astro +12 -4
- package/components/Prose.astro +2 -2
- package/components/QRCode.astro +13 -5
- package/components/RadioGroup.astro +3 -3
- package/components/Rating.astro +3 -1
- package/components/Resizable.astro +8 -7
- package/components/RevealGroup.astro +4 -2
- package/components/RichTextEditor.astro +3 -2
- package/components/Schedule.astro +3 -2
- package/components/ScrollArea.astro +6 -6
- package/components/ScrollProgress.astro +2 -2
- package/components/ScrollReveal.astro +4 -2
- package/components/SearchField.astro +3 -2
- package/components/Segmented.astro +4 -6
- package/components/Select.astro +23 -14
- package/components/Separator.astro +5 -5
- package/components/Sheet.astro +7 -13
- package/components/Sidebar.astro +9 -14
- package/components/Skeleton.astro +4 -3
- package/components/SkipLink.astro +2 -2
- package/components/Slider.astro +3 -2
- package/components/Sonner.astro +3 -3
- package/components/Sparkline.astro +9 -9
- package/components/SpeedDial.astro +3 -3
- package/components/Spinner.astro +4 -3
- package/components/Stack.astro +46 -0
- package/components/Stat.astro +6 -5
- package/components/StatDescription.astro +16 -0
- package/components/StatIcon.astro +15 -0
- package/components/StatLabel.astro +16 -0
- package/components/StatTrend.astro +28 -0
- package/components/StatValue.astro +16 -0
- package/components/Stepper.astro +11 -8
- package/components/Switch.astro +3 -2
- package/components/Table.astro +7 -6
- package/components/Tabs.astro +6 -6
- package/components/TagGroup.astro +3 -2
- package/components/Textarea.astro +3 -2
- package/components/ThemeBuilder.astro +3 -2
- package/components/ThemeToggle.astro +5 -3
- package/components/TimeField.astro +3 -2
- package/components/Timeline.astro +2 -1
- package/components/TimelineItem.astro +2 -1
- package/components/Toast.astro +10 -16
- package/components/Toggle.astro +3 -2
- package/components/ToggleGroup.astro +3 -3
- package/components/Toolbar.astro +2 -2
- package/components/Tooltip.astro +3 -3
- package/components/Tour.astro +3 -3
- package/components/Transfer.astro +16 -5
- package/components/Tree.astro +3 -2
- package/components/TreeGrid.astro +3 -2
- package/components/TreeSelect.astro +10 -4
- package/components/Typography.astro +3 -3
- package/components/VirtualList.astro +3 -2
- package/components/VisuallyHidden.astro +27 -0
- package/components/Watermark.astro +10 -6
- package/forms.ts +46 -0
- package/index.ts +26 -0
- package/package.json +13 -9
- package/runtime/UIPrimitives.astro +3755 -3176
- package/runtime/controllers/motion.ts +13 -16
- package/index.d.ts +0 -131
package/README.md
CHANGED
|
@@ -51,6 +51,44 @@ import { Button, Card, Input } from '@santi020k/lumen-astro'
|
|
|
51
51
|
</Card>
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
+
`Input` and `NativeSelect` preserve the native numeric `size` attribute. Use `visualSize="sm"` or
|
|
55
|
+
`visualSize="lg"` for presentation. The pre-1.0 `size="sm|lg"` visual alias remains available for
|
|
56
|
+
incremental migrations, but new code should keep native behavior and visual styling separate.
|
|
57
|
+
|
|
58
|
+
```astro
|
|
59
|
+
<Input size={32} visualSize="sm" />
|
|
60
|
+
<NativeSelect size={8} visualSize="lg" />
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Forms and Astro Actions
|
|
64
|
+
|
|
65
|
+
`Form` renders a semantic form and preserves native `method`, `action`, `enctype`, autocomplete,
|
|
66
|
+
reset, and no-JavaScript submission. Compose it with `Field`, `Label`, `FieldError`, and
|
|
67
|
+
`ErrorSummary`.
|
|
68
|
+
|
|
69
|
+
Astro Actions remain application-owned. Use `accept: 'form'`, read the result with
|
|
70
|
+
`Astro.getActionResult()`, and pass `ActionInputError` to `normalizeAstroActionErrors()` so field
|
|
71
|
+
errors receive stable control IDs.
|
|
72
|
+
|
|
73
|
+
```astro
|
|
74
|
+
---
|
|
75
|
+
import { actions, isInputError } from 'astro:actions'
|
|
76
|
+
import { ErrorSummary, Form, normalizeAstroActionErrors } from '@santi020k/lumen-astro'
|
|
77
|
+
|
|
78
|
+
const result = Astro.getActionResult(actions.updateProfile)
|
|
79
|
+
const errors = result?.error && isInputError(result.error)
|
|
80
|
+
? normalizeAstroActionErrors(result.error)
|
|
81
|
+
: normalizeAstroActionErrors(result?.error)
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
<Form action={actions.updateProfile} method="POST">
|
|
85
|
+
<ErrorSummary {errors} />
|
|
86
|
+
<!-- fields -->
|
|
87
|
+
</Form>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
See the [Astro Actions form guide](https://lumen.santi020k.com/docs/forms/astro-actions).
|
|
91
|
+
|
|
54
92
|
Use `Icon` for Lucide icons by name across framework adapters.
|
|
55
93
|
|
|
56
94
|
```astro
|
|
@@ -67,13 +105,14 @@ import { Button, Icon } from '@santi020k/lumen-astro'
|
|
|
67
105
|
|
|
68
106
|
## Long-form navigation
|
|
69
107
|
|
|
70
|
-
`Anchor` accepts
|
|
71
|
-
|
|
72
|
-
|
|
108
|
+
`Anchor` accepts heading `depth`, `index`, and `description` metadata plus an `activationOffset`.
|
|
109
|
+
Its current link stays synchronized on click and scroll, including at the end of the document.
|
|
110
|
+
`ScrollProgress` derives reading progress from the document and pins the indicator to the top or
|
|
111
|
+
bottom viewport edge. Both use the single root `UIPrimitives` runtime.
|
|
73
112
|
|
|
74
113
|
```astro
|
|
75
114
|
---
|
|
76
|
-
import { Anchor, ScrollProgress } from '@santi020k/lumen-astro'
|
|
115
|
+
import { Anchor, CopyButton, ScrollProgress } from '@santi020k/lumen-astro'
|
|
77
116
|
---
|
|
78
117
|
|
|
79
118
|
<ScrollProgress aria-label="Article reading progress" />
|
|
@@ -83,6 +122,15 @@ import { Anchor, ScrollProgress } from '@santi020k/lumen-astro'
|
|
|
83
122
|
]} />
|
|
84
123
|
```
|
|
85
124
|
|
|
125
|
+
`Progress` can be updated after hydration by dispatching `ui:progress-change` from its root with
|
|
126
|
+
`{ value, max? }`. Use `CopyButton` to copy arbitrary text or a referenced element without giving
|
|
127
|
+
non-code content `Code` semantics.
|
|
128
|
+
|
|
129
|
+
```astro
|
|
130
|
+
<p id="invite">Join the Lumen workspace</p>
|
|
131
|
+
<CopyButton target="#invite" toast>Copy invite</CopyButton>
|
|
132
|
+
```
|
|
133
|
+
|
|
86
134
|
## Data visualization
|
|
87
135
|
|
|
88
136
|
Use `Sparkline` beside a metric, `BarChart` for categorical comparison, `LineChart` for ordered
|
|
@@ -204,8 +252,7 @@ content readable without JavaScript and honor reduced-motion preferences.
|
|
|
204
252
|
|
|
205
253
|
Lumen includes glassmorphism tokens and reusable classes in the shared stylesheet. Cards use a
|
|
206
254
|
boolean prop, and overlays or navigation primitives use the same prop while preserving semantic
|
|
207
|
-
variants. The older `variant="glass"` form remains supported for cards.
|
|
208
|
-
`surface="glass"` props are deprecated compatibility aliases that map to `glass`.
|
|
255
|
+
variants. The older `variant="glass"` form remains supported for cards.
|
|
209
256
|
|
|
210
257
|
```astro
|
|
211
258
|
<Card glass>Glass card</Card>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
3
|
-
|
|
4
2
|
import type { HTMLAttributes } from 'astro/types'
|
|
5
3
|
|
|
4
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
5
|
+
|
|
6
6
|
type AccordionVariant = 'default' | 'flush'
|
|
7
7
|
|
|
8
8
|
interface Props extends HTMLAttributes<'div'> {
|
|
@@ -19,8 +19,8 @@ const {
|
|
|
19
19
|
} = Astro.props
|
|
20
20
|
|
|
21
21
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
'ui-accordion',
|
|
23
|
+
variant === 'flush' && 'ui-accordion--flush'
|
|
24
24
|
], classProp, className)
|
|
25
25
|
---
|
|
26
26
|
|
package/components/Affix.astro
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
3
|
-
|
|
4
2
|
import type { HTMLAttributes } from 'astro/types'
|
|
5
3
|
|
|
4
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
5
|
+
|
|
6
6
|
interface Props extends HTMLAttributes<'div'> {
|
|
7
7
|
class?: string | null
|
|
8
8
|
className?: string
|
package/components/Agenda.astro
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
3
|
-
|
|
4
2
|
import type { HTMLAttributes } from 'astro/types'
|
|
5
3
|
|
|
4
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
5
|
+
|
|
6
6
|
interface Props extends HTMLAttributes<'section'> {
|
|
7
7
|
class?: string | null
|
|
8
8
|
className?: string
|
|
@@ -10,6 +10,7 @@ interface Props extends HTMLAttributes<'section'> {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
const { class: classProp = '', className = '', glass = false, ...rest } = Astro.props
|
|
13
|
+
|
|
13
14
|
const { classList, passthrough } = resolveLumenAstroProps(rest, ['ui-agenda', glass && 'ui-agenda--glass', glass === 'subtle' && 'ui-glass-subtle', glass === 'strong' && 'ui-glass-strong'
|
|
14
15
|
], classProp, className)
|
|
15
16
|
---
|
package/components/Alert.astro
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
3
|
-
|
|
4
2
|
import type { HTMLAttributes } from 'astro/types'
|
|
5
3
|
|
|
4
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
5
|
+
|
|
6
6
|
interface Props extends HTMLAttributes<'aside'> {
|
|
7
7
|
class?: string | null
|
|
8
8
|
className?: string
|
|
@@ -19,13 +19,13 @@ const {
|
|
|
19
19
|
} = Astro.props
|
|
20
20
|
|
|
21
21
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
'ui-alert',
|
|
23
|
+
variant === 'destructive' && 'ui-alert--destructive',
|
|
24
|
+
variant === 'success' && 'ui-alert--success',
|
|
25
|
+
variant === 'warning' && 'ui-alert--warning',
|
|
26
|
+
glass && 'ui-alert--glass',
|
|
27
|
+
glass === 'subtle' && 'ui-glass-subtle',
|
|
28
|
+
glass === 'strong' && 'ui-glass-strong'
|
|
29
29
|
], classProp, className)
|
|
30
30
|
---
|
|
31
31
|
|
|
@@ -1,37 +1,31 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { resolveLumenAstroProps, resolveLumenGlass } from '@santi020k/lumen-core'
|
|
3
|
-
|
|
4
2
|
import type { HTMLAttributes } from 'astro/types'
|
|
5
3
|
|
|
4
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
5
|
+
|
|
6
6
|
interface Props extends HTMLAttributes<'dialog'> {
|
|
7
7
|
class?: string | null
|
|
8
8
|
className?: string
|
|
9
9
|
glass?: boolean | 'subtle' | 'strong'
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated Use `glass` instead. `surface="glass"` maps to `glass={true}`.
|
|
12
|
-
*/
|
|
13
|
-
surface?: 'default' | 'glass'
|
|
14
10
|
}
|
|
15
11
|
|
|
16
12
|
const {
|
|
17
13
|
class: classProp = '',
|
|
18
14
|
className = '',
|
|
19
15
|
glass = false,
|
|
20
|
-
surface = 'default',
|
|
21
16
|
...rest
|
|
22
17
|
} = Astro.props
|
|
23
18
|
|
|
24
|
-
const resolvedGlass = resolveLumenGlass(glass, surface)
|
|
25
19
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
20
|
+
'ui-dialog ui-alert-dialog',
|
|
21
|
+
glass && 'ui-dialog--glass',
|
|
22
|
+
glass === 'subtle' && 'ui-glass-subtle',
|
|
23
|
+
glass === 'strong' && 'ui-glass-strong'
|
|
30
24
|
], classProp, className)
|
|
31
25
|
---
|
|
32
26
|
|
|
33
27
|
<dialog
|
|
34
|
-
data-surface={
|
|
28
|
+
data-surface={glass ? 'glass' : 'default'}
|
|
35
29
|
data-ui-alert-dialog
|
|
36
30
|
role="alertdialog"
|
|
37
31
|
class:list={classList}
|
package/components/Anchor.astro
CHANGED
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
3
|
-
|
|
4
2
|
import type { HTMLAttributes } from 'astro/types'
|
|
5
3
|
|
|
4
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
5
|
+
|
|
6
6
|
type AnchorDepth = 1 | 2 | 3 | 4 | 5 | 6
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
interface AnchorLink {
|
|
9
|
+
description?: string
|
|
9
10
|
depth?: AnchorDepth
|
|
10
11
|
href: string
|
|
12
|
+
index?: number | string
|
|
11
13
|
label: string
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
export interface Props extends HTMLAttributes<'nav'> {
|
|
15
17
|
class?: string | null
|
|
16
18
|
className?: string
|
|
19
|
+
activationOffset?: number
|
|
17
20
|
items?: AnchorLink[]
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
const {
|
|
21
24
|
'aria-label': ariaLabel = 'On this page',
|
|
25
|
+
activationOffset = 96,
|
|
22
26
|
class: classProp = '',
|
|
23
27
|
className = '',
|
|
24
28
|
items = [],
|
|
@@ -34,6 +38,7 @@ const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
|
34
38
|
aria-label={ariaLabel}
|
|
35
39
|
class:list={classList}
|
|
36
40
|
data-ui-anchor
|
|
41
|
+
data-ui-anchor-offset={Math.max(0, activationOffset)}
|
|
37
42
|
{...passthrough}
|
|
38
43
|
>
|
|
39
44
|
{items.length > 0 && (
|
|
@@ -41,11 +46,20 @@ const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
|
41
46
|
{items.map((item, index) => (
|
|
42
47
|
<li>
|
|
43
48
|
<a
|
|
49
|
+
aria-current={index === 0 ? 'location' : undefined}
|
|
44
50
|
data-active={index === 0 ? 'true' : 'false'}
|
|
45
51
|
data-depth={item.depth}
|
|
46
52
|
href={item.href}
|
|
47
53
|
>
|
|
48
|
-
{item.
|
|
54
|
+
{item.index !== undefined && (
|
|
55
|
+
<span class="ui-anchor__index">{item.index}</span>
|
|
56
|
+
)}
|
|
57
|
+
<span class="ui-anchor__content">
|
|
58
|
+
<span class="ui-anchor__label">{item.label}</span>
|
|
59
|
+
{item.description && (
|
|
60
|
+
<span class="ui-anchor__description">{item.description}</span>
|
|
61
|
+
)}
|
|
62
|
+
</span>
|
|
49
63
|
</a>
|
|
50
64
|
</li>
|
|
51
65
|
))}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
3
2
|
import type { HTMLAttributes } from 'astro/types'
|
|
4
3
|
|
|
4
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
5
|
+
|
|
5
6
|
interface Props extends HTMLAttributes<'span'> {
|
|
6
7
|
animation?: 'reveal' | 'sequence'
|
|
7
8
|
class?: string | null
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
3
|
-
|
|
4
2
|
import type { HTMLAttributes } from 'astro/types'
|
|
5
3
|
|
|
4
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
5
|
+
|
|
6
6
|
interface Props extends Omit<HTMLAttributes<'span'>, 'prefix'> {
|
|
7
7
|
class?: string | null
|
|
8
8
|
className?: string
|
|
@@ -29,11 +29,14 @@ const {
|
|
|
29
29
|
} = Astro.props
|
|
30
30
|
|
|
31
31
|
const safeDecimals = Math.max(0, Math.min(20, Math.floor(decimals)))
|
|
32
|
+
|
|
32
33
|
const formatter = new Intl.NumberFormat(locale, {
|
|
33
34
|
maximumFractionDigits: safeDecimals,
|
|
34
35
|
minimumFractionDigits: safeDecimals
|
|
35
36
|
})
|
|
37
|
+
|
|
36
38
|
const formattedValue = `${prefix}${formatter.format(value)}${suffix}`
|
|
39
|
+
|
|
37
40
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
38
41
|
'ui-animated-number',
|
|
39
42
|
`ui-motion-duration-${duration}`
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
3
2
|
import type { ImageMetadata } from 'astro'
|
|
3
|
+
import type { HTMLAttributes } from 'astro/types'
|
|
4
|
+
|
|
4
5
|
import { Picture } from 'astro:assets'
|
|
5
6
|
|
|
6
|
-
import
|
|
7
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
7
8
|
|
|
8
9
|
interface Props extends HTMLAttributes<'div'> {
|
|
9
10
|
alt: string
|
|
@@ -70,42 +71,48 @@ const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
|
70
71
|
aria-hidden="true"
|
|
71
72
|
class="ui-animated-portrait__wash"
|
|
72
73
|
/>
|
|
73
|
-
{typeof src === 'string'
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
74
|
+
{typeof src === 'string' ?
|
|
75
|
+
(
|
|
76
|
+
<Picture
|
|
77
|
+
alt={alt}
|
|
78
|
+
class="ui-animated-portrait__image"
|
|
79
|
+
decoding="sync"
|
|
80
|
+
fetchpriority="high"
|
|
81
|
+
formats={['avif', 'webp']}
|
|
82
|
+
height={440}
|
|
83
|
+
loading="eager"
|
|
84
|
+
sizes={sizes}
|
|
85
|
+
src={src}
|
|
86
|
+
width={352}
|
|
87
|
+
widths={widths}
|
|
88
|
+
/>
|
|
89
|
+
) :
|
|
90
|
+
(
|
|
91
|
+
<Picture
|
|
92
|
+
alt={alt}
|
|
93
|
+
class="ui-animated-portrait__image"
|
|
94
|
+
decoding="sync"
|
|
95
|
+
fetchpriority="high"
|
|
96
|
+
formats={['avif', 'webp']}
|
|
97
|
+
height={440}
|
|
98
|
+
loading="eager"
|
|
99
|
+
sizes={sizes}
|
|
100
|
+
src={src}
|
|
101
|
+
width={352}
|
|
102
|
+
widths={widths}
|
|
103
|
+
/>
|
|
104
|
+
)}
|
|
104
105
|
</div>
|
|
105
106
|
|
|
106
107
|
{showFloatingBadges && badgeProps?.location && (
|
|
107
|
-
<div class="
|
|
108
|
-
|
|
108
|
+
<div class="
|
|
109
|
+
ui-animated-portrait__badge ui-animated-portrait__badge--location
|
|
110
|
+
"
|
|
111
|
+
>
|
|
112
|
+
<p class="
|
|
113
|
+
ui-animated-portrait__label ui-animated-portrait__label--location
|
|
114
|
+
"
|
|
115
|
+
>
|
|
109
116
|
<span class="ui-animated-portrait__status" />
|
|
110
117
|
{badgeProps.location.label}
|
|
111
118
|
</p>
|
|
@@ -114,7 +121,10 @@ const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
|
114
121
|
)}
|
|
115
122
|
|
|
116
123
|
{showFloatingBadges && badgeProps?.experience && (
|
|
117
|
-
<div class="
|
|
124
|
+
<div class="
|
|
125
|
+
ui-animated-portrait__badge ui-animated-portrait__badge--experience
|
|
126
|
+
"
|
|
127
|
+
>
|
|
118
128
|
<p class="ui-animated-portrait__label">{badgeProps.experience.label}</p>
|
|
119
129
|
<p class="ui-animated-portrait__experience">
|
|
120
130
|
{badgeProps.experience.value}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
3
|
-
|
|
4
2
|
import type { HTMLAttributes } from 'astro/types'
|
|
5
3
|
|
|
4
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
5
|
+
|
|
6
6
|
interface Props extends HTMLAttributes<'div'> {
|
|
7
7
|
class?: string | null
|
|
8
8
|
className?: string
|
|
@@ -17,16 +17,18 @@ const {
|
|
|
17
17
|
} = Astro.props
|
|
18
18
|
|
|
19
19
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
20
|
-
|
|
20
|
+
'ui-aspect-ratio'
|
|
21
21
|
], classProp, className)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
|
|
23
|
+
let ratioValue = ''
|
|
24
|
+
|
|
25
|
+
if (typeof ratio === 'number' && Number.isFinite(ratio)) ratioValue = String(ratio)
|
|
26
|
+
else if (typeof ratio === 'string') ratioValue = ratio.trim()
|
|
27
|
+
|
|
27
28
|
const isValidRatio =
|
|
28
29
|
/^\d+(\.\d+)?(\s*\/\s*\d+(\.\d+)?)?$/.test(ratioValue) &&
|
|
29
30
|
ratioValue.split('/').every(value => Number(value.trim()) > 0)
|
|
31
|
+
|
|
30
32
|
const safeRatio = isValidRatio ? ratioValue : '16 / 9'
|
|
31
33
|
---
|
|
32
34
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
3
|
-
|
|
4
2
|
import type { HTMLAttributes } from 'astro/types'
|
|
5
3
|
|
|
4
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
5
|
+
|
|
6
6
|
interface Props extends HTMLAttributes<'article'> {
|
|
7
7
|
class?: string | null
|
|
8
8
|
className?: string
|
|
@@ -19,28 +19,28 @@ const {
|
|
|
19
19
|
} = Astro.props
|
|
20
20
|
|
|
21
21
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
'ui-attachment',
|
|
23
|
+
glass && 'ui-attachment--glass',
|
|
24
|
+
glass === 'subtle' && 'ui-glass-subtle',
|
|
25
|
+
glass === 'strong' && 'ui-glass-strong'
|
|
26
26
|
], classProp, className)
|
|
27
27
|
---
|
|
28
28
|
|
|
29
|
-
{href
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
29
|
+
{href ?
|
|
30
|
+
(
|
|
31
|
+
<a
|
|
32
|
+
href={href}
|
|
33
|
+
class:list={classList}
|
|
34
|
+
{...passthrough}
|
|
35
|
+
>
|
|
36
|
+
<slot />
|
|
37
|
+
</a>
|
|
38
|
+
) :
|
|
39
|
+
(
|
|
40
|
+
<article
|
|
41
|
+
class:list={classList}
|
|
42
|
+
{...passthrough}
|
|
43
|
+
>
|
|
44
|
+
<slot />
|
|
45
|
+
</article>
|
|
46
|
+
)}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
3
|
-
|
|
4
2
|
import type { HTMLAttributes } from 'astro/types'
|
|
5
3
|
|
|
4
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
5
|
+
|
|
6
6
|
interface Props extends HTMLAttributes<'input'> {
|
|
7
7
|
class?: string | null
|
|
8
8
|
className?: string
|
|
@@ -10,6 +10,7 @@ interface Props extends HTMLAttributes<'input'> {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
const { class: classProp = '', className = '', type = 'search', ...rest } = Astro.props
|
|
13
|
+
|
|
13
14
|
const { classList, passthrough } = resolveLumenAstroProps(rest, ['ui-input', 'ui-autocomplete'
|
|
14
15
|
], classProp, className)
|
|
15
16
|
---
|
package/components/Avatar.astro
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
3
|
-
|
|
4
2
|
import type { HTMLAttributes } from 'astro/types'
|
|
5
3
|
|
|
4
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
5
|
+
|
|
6
6
|
interface Props extends HTMLAttributes<'span'> {
|
|
7
7
|
class?: string | null
|
|
8
8
|
className?: string
|
|
@@ -22,8 +22,9 @@ const {
|
|
|
22
22
|
|
|
23
23
|
const hasDefaultSlot = Astro.slots.has('default')
|
|
24
24
|
const fallbackText = fallback ?? (!src && !hasDefaultSlot ? '?' : undefined)
|
|
25
|
+
|
|
25
26
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
26
|
-
|
|
27
|
+
'ui-avatar'
|
|
27
28
|
], classProp, className)
|
|
28
29
|
---
|
|
29
30
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
3
|
-
|
|
4
2
|
import type { HTMLAttributes } from 'astro/types'
|
|
5
3
|
|
|
4
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
5
|
+
|
|
6
6
|
interface Props extends HTMLAttributes<'button'> {
|
|
7
7
|
class?: string | null
|
|
8
8
|
className?: string
|
package/components/Badge.astro
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
3
|
-
|
|
4
2
|
import type { HTMLAttributes } from 'astro/types'
|
|
5
3
|
|
|
4
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
5
|
+
|
|
6
6
|
interface Props extends HTMLAttributes<'span'> {
|
|
7
7
|
class?: string | null
|
|
8
8
|
className?: string
|
|
@@ -17,13 +17,13 @@ const {
|
|
|
17
17
|
} = Astro.props
|
|
18
18
|
|
|
19
19
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
'ui-badge',
|
|
21
|
+
variant === 'default' && 'ui-badge--default',
|
|
22
|
+
variant === 'secondary' && 'ui-badge--secondary',
|
|
23
|
+
variant === 'outline' && 'ui-badge--outline',
|
|
24
|
+
variant === 'destructive' && 'ui-badge--destructive',
|
|
25
|
+
variant === 'success' && 'ui-badge--success',
|
|
26
|
+
variant === 'warning' && 'ui-badge--warning'
|
|
27
27
|
], classProp, className)
|
|
28
28
|
---
|
|
29
29
|
|