@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.
Files changed (158) hide show
  1. package/README.md +100 -2
  2. package/components/Accordion.astro +4 -4
  3. package/components/Affix.astro +2 -2
  4. package/components/Agenda.astro +3 -2
  5. package/components/Alert.astro +9 -9
  6. package/components/AlertDialog.astro +7 -13
  7. package/components/Anchor.astro +29 -3
  8. package/components/AnimatedLogo.astro +2 -1
  9. package/components/AnimatedNumber.astro +5 -2
  10. package/components/AnimatedPortrait.astro +46 -36
  11. package/components/AspectRatio.astro +10 -8
  12. package/components/Attachment.astro +24 -24
  13. package/components/Autocomplete.astro +3 -2
  14. package/components/Avatar.astro +4 -3
  15. package/components/BackToTop.astro +2 -2
  16. package/components/Badge.astro +9 -9
  17. package/components/BarChart.astro +211 -0
  18. package/components/Breadcrumb.astro +3 -3
  19. package/components/Bubble.astro +7 -7
  20. package/components/Button.astro +18 -16
  21. package/components/ButtonGroup.astro +3 -3
  22. package/components/ButtonLink.astro +9 -3
  23. package/components/Calendar.astro +43 -31
  24. package/components/Callout.astro +2 -2
  25. package/components/Card.astro +12 -10
  26. package/components/CardContent.astro +26 -0
  27. package/components/CardDescription.astro +26 -0
  28. package/components/CardFooter.astro +26 -0
  29. package/components/CardHeader.astro +26 -0
  30. package/components/CardTitle.astro +26 -0
  31. package/components/Carousel.astro +6 -6
  32. package/components/Cascader.astro +10 -4
  33. package/components/Chart.astro +32 -6
  34. package/components/Checkbox.astro +3 -2
  35. package/components/CheckboxGroup.astro +39 -0
  36. package/components/Code.astro +55 -52
  37. package/components/CodeTabs.astro +6 -6
  38. package/components/Collapsible.astro +3 -3
  39. package/components/ColorPicker.astro +3 -2
  40. package/components/Combobox.astro +4 -5
  41. package/components/Command.astro +6 -6
  42. package/components/Container.astro +29 -0
  43. package/components/ContextMenu.astro +7 -13
  44. package/components/CopyButton.astro +55 -0
  45. package/components/CoverImage.astro +19 -9
  46. package/components/DataTable.astro +50 -49
  47. package/components/DatePicker.astro +20 -17
  48. package/components/DateRangePicker.astro +3 -2
  49. package/components/Descriptions.astro +3 -3
  50. package/components/Dialog.astro +8 -14
  51. package/components/Direction.astro +3 -3
  52. package/components/Drawer.astro +7 -13
  53. package/components/DropdownMenu.astro +7 -13
  54. package/components/Empty.astro +6 -6
  55. package/components/ErrorSummary.astro +54 -0
  56. package/components/Eyebrow.astro +2 -2
  57. package/components/Field.astro +7 -6
  58. package/components/FieldError.astro +29 -0
  59. package/components/FileUpload.astro +2 -2
  60. package/components/FloatingBadge.astro +2 -2
  61. package/components/Form.astro +33 -0
  62. package/components/FormattedDate.astro +2 -2
  63. package/components/GradientDivider.astro +2 -2
  64. package/components/Grid.astro +46 -0
  65. package/components/HoverCard.astro +7 -13
  66. package/components/Icon.astro +8 -6
  67. package/components/Image.astro +2 -1
  68. package/components/Input.astro +6 -5
  69. package/components/InputGroup.astro +3 -3
  70. package/components/InputOTP.astro +5 -3
  71. package/components/Item.astro +11 -8
  72. package/components/Kbd.astro +3 -3
  73. package/components/Label.astro +3 -2
  74. package/components/LanguageToggle.astro +2 -2
  75. package/components/LineChart.astro +244 -0
  76. package/components/Link.astro +6 -5
  77. package/components/ListBox.astro +154 -0
  78. package/components/Marker.astro +6 -6
  79. package/components/Mentions.astro +30 -10
  80. package/components/Menubar.astro +7 -13
  81. package/components/Message.astro +5 -5
  82. package/components/MessageScroller.astro +6 -6
  83. package/components/Meter.astro +1 -0
  84. package/components/NativeSelect.astro +4 -5
  85. package/components/NavigationMenu.astro +9 -14
  86. package/components/Note.astro +1 -1
  87. package/components/NumberField.astro +3 -2
  88. package/components/Pagination.astro +3 -3
  89. package/components/Particles.astro +58 -2
  90. package/components/PasswordField.astro +73 -0
  91. package/components/PhoneInput.astro +5 -7
  92. package/components/PieChart.astro +141 -0
  93. package/components/Pill.astro +15 -9
  94. package/components/Popconfirm.astro +8 -3
  95. package/components/Popover.astro +7 -13
  96. package/components/Progress.astro +12 -4
  97. package/components/Prose.astro +2 -2
  98. package/components/QRCode.astro +13 -5
  99. package/components/RadioGroup.astro +3 -3
  100. package/components/Rating.astro +3 -1
  101. package/components/Resizable.astro +8 -7
  102. package/components/RevealGroup.astro +4 -2
  103. package/components/RichTextEditor.astro +3 -2
  104. package/components/Schedule.astro +3 -2
  105. package/components/ScrollArea.astro +6 -6
  106. package/components/ScrollProgress.astro +38 -0
  107. package/components/ScrollReveal.astro +4 -2
  108. package/components/SearchField.astro +3 -2
  109. package/components/Segmented.astro +4 -6
  110. package/components/Select.astro +23 -14
  111. package/components/Separator.astro +5 -5
  112. package/components/Sheet.astro +7 -13
  113. package/components/Sidebar.astro +9 -14
  114. package/components/Skeleton.astro +4 -3
  115. package/components/SkipLink.astro +2 -2
  116. package/components/Slider.astro +3 -2
  117. package/components/Sonner.astro +3 -3
  118. package/components/Sparkline.astro +72 -0
  119. package/components/SpeedDial.astro +3 -3
  120. package/components/Spinner.astro +4 -3
  121. package/components/Stack.astro +46 -0
  122. package/components/Stat.astro +14 -8
  123. package/components/StatDescription.astro +16 -0
  124. package/components/StatIcon.astro +15 -0
  125. package/components/StatLabel.astro +16 -0
  126. package/components/StatTrend.astro +28 -0
  127. package/components/StatValue.astro +16 -0
  128. package/components/Stepper.astro +11 -8
  129. package/components/Switch.astro +3 -2
  130. package/components/Table.astro +7 -6
  131. package/components/Tabs.astro +6 -6
  132. package/components/TagGroup.astro +3 -2
  133. package/components/Textarea.astro +3 -2
  134. package/components/ThemeBuilder.astro +3 -2
  135. package/components/ThemeToggle.astro +5 -3
  136. package/components/TimeField.astro +3 -2
  137. package/components/Timeline.astro +2 -1
  138. package/components/TimelineItem.astro +2 -1
  139. package/components/Toast.astro +10 -16
  140. package/components/Toggle.astro +3 -2
  141. package/components/ToggleGroup.astro +3 -3
  142. package/components/Toolbar.astro +2 -2
  143. package/components/Tooltip.astro +3 -3
  144. package/components/Tour.astro +3 -3
  145. package/components/Transfer.astro +16 -5
  146. package/components/Tree.astro +3 -2
  147. package/components/TreeGrid.astro +3 -2
  148. package/components/TreeSelect.astro +10 -4
  149. package/components/Typography.astro +3 -3
  150. package/components/VirtualList.astro +3 -2
  151. package/components/VisuallyHidden.astro +27 -0
  152. package/components/Watermark.astro +11 -7
  153. package/forms.ts +46 -0
  154. package/index.ts +31 -0
  155. package/package.json +12 -8
  156. package/runtime/UIPrimitives.astro +3764 -3142
  157. package/runtime/controllers/motion.ts +13 -16
  158. package/index.d.ts +0 -126
@@ -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
- ? <a class:list={classList} href={href} {...passthrough}>
29
+ {href ?
30
+ (
31
+ <a class:list={classList} data-variant={variant} href={href} {...passthrough}>
28
32
  <slot />
29
- {count != null && <span class="ui-pill__count">{count}</span>}
33
+ {count !== undefined && <span class="ui-pill__count">{count}</span>}
30
34
  </a>
31
- : <span class:list={classList} {...passthrough}>
35
+ ) :
36
+ (
37
+ <span class:list={classList} data-variant={variant} {...passthrough}>
32
38
  <slot />
33
- {count != null && <span class="ui-pill__count">{count}</span>}
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 aria-expanded="false" aria-haspopup="dialog" class="ui-popconfirm__trigger" data-ui-trigger>
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">
@@ -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
- 'ui-popover',
27
- resolvedGlass && 'ui-popover--glass',
28
- glass === 'subtle' && 'ui-glass-subtle',
29
- glass === 'strong' && 'ui-glass-strong'
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={resolvedGlass ? 'glass' : 'default'}
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
- const { classList, passthrough } = resolveLumenAstroProps(rest, ['ui-progress'
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 class="ui-progress__bar" style={`width: ${percentage}%`}></span>
32
+ <span
33
+ class="ui-progress__bar"
34
+ data-slot="progress-indicator"
35
+ style={`width: ${percentage}%`}
36
+ >
37
+ </span>
30
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
  class?: string | null
8
8
  className?: string
@@ -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
- ? <img alt={value ? `QR code for ${value}` : 'QR code'} class="ui-qr-code__image" height={size} src={qrSrc} width={size} />
41
- : <slot />}
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
- 'ui-radio-group'
18
+ 'ui-radio-group'
19
19
  ], classProp, className)
20
20
  ---
21
21
 
@@ -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((star) => (
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
- 'ui-resizable',
29
- direction === 'vertical' && 'ui-resizable--vertical'
28
+ 'ui-resizable',
29
+ direction === 'vertical' && 'ui-resizable--vertical'
30
30
  ], classProp, className)
31
- const serializeSize = (value: number | number[] | undefined) =>
32
- Array.isArray(value) ? value.join(',') : value
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
- ></button>
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
- 'ui-scroll-area',
21
- glass && 'ui-scroll-area--glass',
22
- glass === 'subtle' && 'ui-glass-subtle',
23
- glass === 'strong' && 'ui-glass-strong'
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
- type SegmentedOption = string | { disabled?: boolean; label: string; value: string }
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',
@@ -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
- typeof option === 'string' ? { label: option, value: option } : option
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 => String(option.value) === selectedValue)
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
- 'ui-select-field',
51
- glass && 'ui-select-field--glass',
52
- glass === 'subtle' && 'ui-glass-subtle',
53
- glass === 'strong' && 'ui-glass-strong'
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 && <option data-ui-select-placeholder disabled selected={!hasSelectedValue} value="">{placeholder}</option>}
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 disabled={option.disabled} selected={selectedValue === String(option.value)} value={option.value}>{option.label}</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 === String(option.value) ? 'true' : 'false'}
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
- 'ui-separator',
21
- orientation === 'horizontal' && 'ui-separator--horizontal',
22
- orientation === 'vertical' && 'ui-separator--vertical'
20
+ 'ui-separator',
21
+ orientation === 'horizontal' && 'ui-separator--horizontal',
22
+ orientation === 'vertical' && 'ui-separator--vertical'
23
23
  ], classProp, className)
24
24
  ---
25
25
 
@@ -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
- 'ui-sheet',
27
- resolvedGlass && 'ui-sheet--glass',
28
- glass === 'subtle' && 'ui-glass-subtle',
29
- glass === 'strong' && 'ui-glass-strong'
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={resolvedGlass ? 'glass' : 'default'}
28
+ data-surface={glass ? 'glass' : 'default'}
35
29
  data-ui-sheet
36
30
  class:list={classList}
37
31
  {...passthrough}
@@ -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
- 'ui-sidebar',
29
- variant === 'unstyled' && 'ui-sidebar--unstyled',
30
- resolvedGlass && 'ui-sidebar--glass',
31
- glass === 'subtle' && 'ui-glass-subtle',
32
- glass === 'strong' && 'ui-glass-strong'
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-surface={resolvedGlass ? 'glass' : 'default'}
31
+ data-slot="sidebar"
32
+ data-surface={glass ? 'glass' : 'default'}
38
33
  data-variant={variant}
39
34
  class:list={classList}
40
35
  {...passthrough}