@santi020k/lumen-astro 0.3.0 → 1.0.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 +100 -2
- 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 +29 -3
- 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 +211 -0
- 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 +32 -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 +6 -5
- 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 +244 -0
- 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 +4 -5
- 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 +58 -2
- package/components/PasswordField.astro +73 -0
- package/components/PhoneInput.astro +5 -7
- package/components/PieChart.astro +141 -0
- package/components/Pill.astro +15 -9
- 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 +38 -0
- 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 +72 -0
- package/components/SpeedDial.astro +3 -3
- package/components/Spinner.astro +4 -3
- package/components/Stack.astro +46 -0
- package/components/Stat.astro +14 -8
- 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 +11 -7
- package/forms.ts +46 -0
- package/index.ts +31 -0
- package/package.json +12 -8
- package/runtime/UIPrimitives.astro +3764 -3142
- package/runtime/controllers/motion.ts +13 -16
- package/index.d.ts +0 -126
package/components/Pill.astro
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
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
|
|
9
9
|
count?: number | string
|
|
10
10
|
href?: string
|
|
11
|
+
variant?: 'brand' | 'neutral' | 'outline'
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
const {
|
|
@@ -15,21 +16,26 @@ const {
|
|
|
15
16
|
className = '',
|
|
16
17
|
count,
|
|
17
18
|
href,
|
|
19
|
+
variant = 'neutral',
|
|
18
20
|
...rest
|
|
19
21
|
} = Astro.props
|
|
20
22
|
|
|
21
23
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
22
|
-
'ui-pill'
|
|
24
|
+
'ui-pill',
|
|
25
|
+
variant !== 'neutral' && `ui-pill--${variant}`
|
|
23
26
|
], classProp, className)
|
|
24
27
|
---
|
|
25
28
|
|
|
26
|
-
{href
|
|
27
|
-
|
|
29
|
+
{href ?
|
|
30
|
+
(
|
|
31
|
+
<a class:list={classList} data-variant={variant} href={href} {...passthrough}>
|
|
28
32
|
<slot />
|
|
29
|
-
{count
|
|
33
|
+
{count !== undefined && <span class="ui-pill__count">{count}</span>}
|
|
30
34
|
</a>
|
|
31
|
-
|
|
35
|
+
) :
|
|
36
|
+
(
|
|
37
|
+
<span class:list={classList} data-variant={variant} {...passthrough}>
|
|
32
38
|
<slot />
|
|
33
|
-
{count
|
|
39
|
+
{count !== undefined && <span class="ui-pill__count">{count}</span>}
|
|
34
40
|
</span>
|
|
35
|
-
}
|
|
41
|
+
)}
|
|
@@ -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
|
cancelLabel?: string
|
|
8
8
|
class?: string | null
|
|
@@ -27,7 +27,12 @@ const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
|
27
27
|
---
|
|
28
28
|
|
|
29
29
|
<div class:list={classList} data-surface="default" data-ui-popconfirm data-ui-popover {...passthrough}>
|
|
30
|
-
<span
|
|
30
|
+
<span
|
|
31
|
+
aria-expanded="false"
|
|
32
|
+
aria-haspopup="dialog"
|
|
33
|
+
class="ui-popconfirm__trigger"
|
|
34
|
+
data-ui-trigger
|
|
35
|
+
>
|
|
31
36
|
<slot />
|
|
32
37
|
</span>
|
|
33
38
|
<div class="ui-popover__panel ui-popconfirm__panel" data-ui-panel hidden role="dialog">
|
package/components/Popover.astro
CHANGED
|
@@ -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<'div'> {
|
|
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-popover',
|
|
21
|
+
glass && 'ui-popover--glass',
|
|
22
|
+
glass === 'subtle' && 'ui-glass-subtle',
|
|
23
|
+
glass === 'strong' && 'ui-glass-strong'
|
|
30
24
|
], classProp, className)
|
|
31
25
|
---
|
|
32
26
|
|
|
33
27
|
<div
|
|
34
|
-
data-surface={
|
|
28
|
+
data-surface={glass ? 'glass' : 'default'}
|
|
35
29
|
data-ui-popover
|
|
36
30
|
class:list={classList}
|
|
37
31
|
{...passthrough}
|
|
@@ -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
|
|
@@ -14,7 +14,9 @@ const { class: classProp = '', className = '', max = 100, value = 0, ...rest } =
|
|
|
14
14
|
const safeMax = max > 0 ? max : 100
|
|
15
15
|
const safeValue = Math.min(safeMax, Math.max(0, value))
|
|
16
16
|
const percentage = (safeValue / safeMax) * 100
|
|
17
|
-
|
|
17
|
+
|
|
18
|
+
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
19
|
+
'ui-progress'
|
|
18
20
|
], classProp, className)
|
|
19
21
|
---
|
|
20
22
|
|
|
@@ -23,8 +25,14 @@ const { classList, passthrough } = resolveLumenAstroProps(rest, ['ui-progress'
|
|
|
23
25
|
aria-valuemin="0"
|
|
24
26
|
aria-valuenow={safeValue}
|
|
25
27
|
class:list={classList}
|
|
28
|
+
data-ui-progress
|
|
26
29
|
role="progressbar"
|
|
27
30
|
{...passthrough}
|
|
28
31
|
>
|
|
29
|
-
<span
|
|
32
|
+
<span
|
|
33
|
+
class="ui-progress__bar"
|
|
34
|
+
data-slot="progress-indicator"
|
|
35
|
+
style={`width: ${percentage}%`}
|
|
36
|
+
>
|
|
37
|
+
</span>
|
|
30
38
|
</div>
|
package/components/Prose.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/QRCode.astro
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types'
|
|
3
|
+
|
|
2
4
|
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
3
5
|
import { renderSVG } from 'uqr'
|
|
4
6
|
|
|
5
|
-
import type { HTMLAttributes } from 'astro/types'
|
|
6
|
-
|
|
7
7
|
interface Props extends HTMLAttributes<'figure'> {
|
|
8
8
|
class?: string | null
|
|
9
9
|
className?: string
|
|
@@ -36,9 +36,17 @@ const qrSrc = qrSvg ? `data:image/svg+xml;utf8,${encodeURIComponent(qrSvg)}` : s
|
|
|
36
36
|
{...passthrough}
|
|
37
37
|
>
|
|
38
38
|
<div class="ui-qr-code__frame">
|
|
39
|
-
{qrSrc
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
{qrSrc ?
|
|
40
|
+
(
|
|
41
|
+
<img
|
|
42
|
+
alt={value ? `QR code for ${value}` : 'QR code'}
|
|
43
|
+
class="ui-qr-code__image"
|
|
44
|
+
height={size}
|
|
45
|
+
src={qrSrc}
|
|
46
|
+
width={size}
|
|
47
|
+
/>
|
|
48
|
+
) :
|
|
49
|
+
<slot />}
|
|
42
50
|
</div>
|
|
43
51
|
{value && <figcaption class="ui-qr-code__value">{value}</figcaption>}
|
|
44
52
|
</figure>
|
|
@@ -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<'fieldset'> {
|
|
7
7
|
class?: string | null
|
|
8
8
|
className?: string
|
|
@@ -15,7 +15,7 @@ const {
|
|
|
15
15
|
} = Astro.props
|
|
16
16
|
|
|
17
17
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
18
|
-
|
|
18
|
+
'ui-radio-group'
|
|
19
19
|
], classProp, className)
|
|
20
20
|
---
|
|
21
21
|
|
package/components/Rating.astro
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { HTMLAttributes } from 'astro/types'
|
|
3
|
+
|
|
3
4
|
import { composeClassName } from '@santi020k/lumen-core'
|
|
5
|
+
|
|
4
6
|
import Icon from './Icon.astro'
|
|
5
7
|
|
|
6
8
|
export interface Props extends HTMLAttributes<'div'> {
|
|
@@ -28,7 +30,7 @@ const stars = Array.from({ length: max }, (_, i) => i + 1)
|
|
|
28
30
|
data-readonly={readonly ? 'true' : 'false'}
|
|
29
31
|
{...props}
|
|
30
32
|
>
|
|
31
|
-
{stars.map(
|
|
33
|
+
{stars.map(star => (
|
|
32
34
|
<button
|
|
33
35
|
type="button"
|
|
34
36
|
class="ui-rating__star"
|
|
@@ -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
|
|
@@ -25,11 +25,11 @@ const {
|
|
|
25
25
|
} = Astro.props
|
|
26
26
|
|
|
27
27
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
'ui-resizable',
|
|
29
|
+
direction === 'vertical' && 'ui-resizable--vertical'
|
|
30
30
|
], classProp, className)
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
|
|
32
|
+
const serializeSize = (value: number | number[] | undefined) => Array.isArray(value) ? value.join(',') : value
|
|
33
33
|
---
|
|
34
34
|
|
|
35
35
|
<div
|
|
@@ -50,6 +50,7 @@ const serializeSize = (value: number | number[] | undefined) =>
|
|
|
50
50
|
role="separator"
|
|
51
51
|
tabindex="0"
|
|
52
52
|
type="button"
|
|
53
|
-
|
|
53
|
+
>
|
|
54
|
+
</button>
|
|
54
55
|
</template>
|
|
55
56
|
</div>
|
|
@@ -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
|
animation?: 'fade' | 'slide-up' | 'scale'
|
|
8
8
|
class?: string | null
|
|
@@ -30,11 +30,13 @@ const {
|
|
|
30
30
|
const safeDelay = Math.max(0, delay)
|
|
31
31
|
const safeStagger = Math.max(0, stagger)
|
|
32
32
|
const safeThreshold = Math.min(1, Math.max(0, threshold))
|
|
33
|
+
|
|
33
34
|
const motionStyle = [
|
|
34
35
|
typeof style === 'string' ? style : '',
|
|
35
36
|
`--ui-reveal-delay:${safeDelay}ms`,
|
|
36
37
|
`--ui-reveal-stagger:${safeStagger}ms`
|
|
37
38
|
].filter(Boolean).join(';')
|
|
39
|
+
|
|
38
40
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
39
41
|
'ui-reveal-group',
|
|
40
42
|
`ui-reveal-group-${animation}`,
|
|
@@ -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-rich-text-editor', glass && 'ui-rich-text-editor--glass', glass === 'subtle' && 'ui-glass-subtle', glass === 'strong' && 'ui-glass-strong'
|
|
14
15
|
], classProp, className)
|
|
15
16
|
---
|
|
@@ -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-schedule', glass && 'ui-schedule--glass', glass === 'subtle' && 'ui-glass-subtle', glass === 'strong' && 'ui-glass-strong'
|
|
14
15
|
], classProp, className)
|
|
15
16
|
---
|
|
@@ -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,10 +17,10 @@ const {
|
|
|
17
17
|
} = Astro.props
|
|
18
18
|
|
|
19
19
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
'ui-scroll-area',
|
|
21
|
+
glass && 'ui-scroll-area--glass',
|
|
22
|
+
glass === 'subtle' && 'ui-glass-subtle',
|
|
23
|
+
glass === 'strong' && 'ui-glass-strong'
|
|
24
24
|
], classProp, className)
|
|
25
25
|
---
|
|
26
26
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types'
|
|
3
|
+
|
|
4
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
5
|
+
|
|
6
|
+
interface Props extends HTMLAttributes<'div'> {
|
|
7
|
+
class?: string | null
|
|
8
|
+
className?: string
|
|
9
|
+
position?: 'bottom' | 'top'
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const {
|
|
13
|
+
'aria-label': ariaLabel = 'Reading progress',
|
|
14
|
+
class: classProp = '',
|
|
15
|
+
className = '',
|
|
16
|
+
position = 'top',
|
|
17
|
+
...rest
|
|
18
|
+
} = Astro.props
|
|
19
|
+
|
|
20
|
+
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
21
|
+
'ui-scroll-progress',
|
|
22
|
+
position === 'bottom' && 'ui-scroll-progress--bottom'
|
|
23
|
+
], classProp, className)
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
<div
|
|
27
|
+
aria-label={ariaLabel}
|
|
28
|
+
aria-valuemax="100"
|
|
29
|
+
aria-valuemin="0"
|
|
30
|
+
aria-valuenow="0"
|
|
31
|
+
class:list={classList}
|
|
32
|
+
data-position={position}
|
|
33
|
+
data-ui-scroll-progress
|
|
34
|
+
role="progressbar"
|
|
35
|
+
{...passthrough}
|
|
36
|
+
>
|
|
37
|
+
<span class="ui-scroll-progress__bar"></span>
|
|
38
|
+
</div>
|
|
@@ -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
|
animation?: 'fade' | 'slide-up' | 'scale'
|
|
8
8
|
class?: string | null
|
|
@@ -27,10 +27,12 @@ const {
|
|
|
27
27
|
|
|
28
28
|
const safeDelay = Math.max(0, delay)
|
|
29
29
|
const safeThreshold = Math.min(1, Math.max(0, threshold))
|
|
30
|
+
|
|
30
31
|
const motionStyle = [
|
|
31
32
|
typeof style === 'string' ? style : '',
|
|
32
33
|
`--ui-reveal-delay:${safeDelay}ms`
|
|
33
34
|
].filter(Boolean).join(';')
|
|
35
|
+
|
|
34
36
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
35
37
|
'ui-scroll-reveal',
|
|
36
38
|
`ui-scroll-reveal-${animation}`,
|
|
@@ -1,14 +1,15 @@
|
|
|
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
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
const { class: classProp = '', className = '', type = 'search', ...rest } = Astro.props
|
|
12
|
+
|
|
12
13
|
const { classList, passthrough } = resolveLumenAstroProps(rest, ['ui-input', 'ui-search-field'
|
|
13
14
|
], classProp, className)
|
|
14
15
|
---
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
3
|
-
|
|
4
2
|
import type { HTMLAttributes } from 'astro/types'
|
|
5
3
|
|
|
6
|
-
|
|
4
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
5
|
+
|
|
6
|
+
type SegmentedOption = string | { disabled?: boolean, label: string, value: string }
|
|
7
7
|
|
|
8
8
|
interface Props extends HTMLAttributes<'div'> {
|
|
9
9
|
class?: string | null
|
|
@@ -27,9 +27,7 @@ const {
|
|
|
27
27
|
...rest
|
|
28
28
|
} = Astro.props
|
|
29
29
|
|
|
30
|
-
const normalized = options.map(option =>
|
|
31
|
-
typeof option === 'string' ? { disabled: false, label: option, value: option } : option
|
|
32
|
-
)
|
|
30
|
+
const normalized = options.map(option => typeof option === 'string' ? { disabled: false, label: option, value: option } : option)
|
|
33
31
|
|
|
34
32
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
35
33
|
'ui-segmented',
|
package/components/Select.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 Option {
|
|
7
7
|
disabled?: boolean
|
|
8
8
|
label: string
|
|
@@ -35,22 +35,21 @@ const {
|
|
|
35
35
|
...rest
|
|
36
36
|
} = Astro.props
|
|
37
37
|
|
|
38
|
-
const normalizedOptions = options.map(option =>
|
|
39
|
-
|
|
40
|
-
)
|
|
41
|
-
const selectedValue = value === undefined || value === null ? undefined : String(value)
|
|
38
|
+
const normalizedOptions = options.map(option => typeof option === 'string' ? { label: option, value: option } : option)
|
|
39
|
+
const selectedValue = value ?? undefined
|
|
42
40
|
const hasSelectedValue = selectedValue !== undefined && selectedValue !== ''
|
|
43
|
-
const selectedOption = normalizedOptions.find(option =>
|
|
41
|
+
const selectedOption = normalizedOptions.find(option => option.value === selectedValue)
|
|
44
42
|
const selectId = id ?? `ui-select-${Math.random().toString(36).slice(2)}`
|
|
45
43
|
const triggerId = `${selectId}-trigger`
|
|
46
44
|
const listId = `${selectId}-listbox`
|
|
47
45
|
const placeholderText = placeholder ?? 'Select an option'
|
|
48
46
|
const triggerText = hasSelectedValue ? selectedOption?.label ?? placeholderText : placeholderText
|
|
47
|
+
|
|
49
48
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
'ui-select-field',
|
|
50
|
+
glass && 'ui-select-field--glass',
|
|
51
|
+
glass === 'subtle' && 'ui-glass-subtle',
|
|
52
|
+
glass === 'strong' && 'ui-glass-strong'
|
|
54
53
|
], classProp, className)
|
|
55
54
|
---
|
|
56
55
|
|
|
@@ -74,10 +73,20 @@ const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
|
74
73
|
required={required}
|
|
75
74
|
{...passthrough}
|
|
76
75
|
>
|
|
77
|
-
{placeholder &&
|
|
76
|
+
{placeholder && (
|
|
77
|
+
<option data-ui-select-placeholder disabled selected={!hasSelectedValue} value="">
|
|
78
|
+
{placeholder}
|
|
79
|
+
</option>
|
|
80
|
+
)}
|
|
78
81
|
<slot />
|
|
79
82
|
{normalizedOptions.map(option => (
|
|
80
|
-
<option
|
|
83
|
+
<option
|
|
84
|
+
disabled={option.disabled}
|
|
85
|
+
selected={selectedValue === option.value}
|
|
86
|
+
value={option.value}
|
|
87
|
+
>
|
|
88
|
+
{option.label}
|
|
89
|
+
</option>
|
|
81
90
|
))}
|
|
82
91
|
</select>
|
|
83
92
|
|
|
@@ -105,7 +114,7 @@ const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
|
105
114
|
{normalizedOptions.map(option => (
|
|
106
115
|
<button
|
|
107
116
|
aria-disabled={option.disabled ? 'true' : undefined}
|
|
108
|
-
aria-selected={selectedValue ===
|
|
117
|
+
aria-selected={selectedValue === option.value ? 'true' : 'false'}
|
|
109
118
|
data-ui-select-option
|
|
110
119
|
data-value={option.value}
|
|
111
120
|
disabled={option.disabled}
|
|
@@ -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<'hr'> {
|
|
7
7
|
class?: string | null
|
|
8
8
|
className?: string
|
|
@@ -17,9 +17,9 @@ const {
|
|
|
17
17
|
} = Astro.props
|
|
18
18
|
|
|
19
19
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
'ui-separator',
|
|
21
|
+
orientation === 'horizontal' && 'ui-separator--horizontal',
|
|
22
|
+
orientation === 'vertical' && 'ui-separator--vertical'
|
|
23
23
|
], classProp, className)
|
|
24
24
|
---
|
|
25
25
|
|
package/components/Sheet.astro
CHANGED
|
@@ -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-sheet',
|
|
21
|
+
glass && 'ui-sheet--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-sheet
|
|
36
30
|
class:list={classList}
|
|
37
31
|
{...passthrough}
|
package/components/Sidebar.astro
CHANGED
|
@@ -1,40 +1,35 @@
|
|
|
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<'aside'> {
|
|
7
7
|
class?: string | null
|
|
8
8
|
className?: string
|
|
9
9
|
glass?: boolean | 'subtle' | 'strong'
|
|
10
10
|
variant?: 'default' | 'unstyled'
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated Use `glass` instead. `surface="glass"` maps to `glass={true}`.
|
|
13
|
-
*/
|
|
14
|
-
surface?: 'default' | 'glass'
|
|
15
11
|
}
|
|
16
12
|
|
|
17
13
|
const {
|
|
18
14
|
class: classProp = '',
|
|
19
15
|
className = '',
|
|
20
16
|
glass = false,
|
|
21
|
-
surface = 'default',
|
|
22
17
|
variant = 'default',
|
|
23
18
|
...rest
|
|
24
19
|
} = Astro.props
|
|
25
20
|
|
|
26
|
-
const resolvedGlass = resolveLumenGlass(glass, surface)
|
|
27
21
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
'ui-sidebar',
|
|
23
|
+
variant === 'unstyled' && 'ui-sidebar--unstyled',
|
|
24
|
+
glass && 'ui-sidebar--glass',
|
|
25
|
+
glass === 'subtle' && 'ui-glass-subtle',
|
|
26
|
+
glass === 'strong' && 'ui-glass-strong'
|
|
33
27
|
], classProp, className)
|
|
34
28
|
---
|
|
35
29
|
|
|
36
30
|
<aside
|
|
37
|
-
data-
|
|
31
|
+
data-slot="sidebar"
|
|
32
|
+
data-surface={glass ? 'glass' : 'default'}
|
|
38
33
|
data-variant={variant}
|
|
39
34
|
class:list={classList}
|
|
40
35
|
{...passthrough}
|