@santi020k/lumen-astro 0.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.
Files changed (131) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +142 -0
  3. package/components/Accordion.astro +27 -0
  4. package/components/Affix.astro +41 -0
  5. package/components/Agenda.astro +19 -0
  6. package/components/Alert.astro +38 -0
  7. package/components/AlertDialog.astro +41 -0
  8. package/components/Anchor.astro +43 -0
  9. package/components/AnimatedLogo.astro +30 -0
  10. package/components/AnimatedNumber.astro +56 -0
  11. package/components/AnimatedPortrait.astro +124 -0
  12. package/components/AspectRatio.astro +39 -0
  13. package/components/Attachment.astro +46 -0
  14. package/components/Autocomplete.astro +24 -0
  15. package/components/Avatar.astro +36 -0
  16. package/components/BackToTop.astro +30 -0
  17. package/components/Badge.astro +36 -0
  18. package/components/Breadcrumb.astro +28 -0
  19. package/components/Bubble.astro +36 -0
  20. package/components/Button.astro +52 -0
  21. package/components/ButtonGroup.astro +27 -0
  22. package/components/ButtonLink.astro +58 -0
  23. package/components/Calendar.astro +197 -0
  24. package/components/Callout.astro +27 -0
  25. package/components/Card.astro +40 -0
  26. package/components/Carousel.astro +33 -0
  27. package/components/Cascader.astro +109 -0
  28. package/components/Chart.astro +32 -0
  29. package/components/Checkbox.astro +22 -0
  30. package/components/Code.astro +96 -0
  31. package/components/Collapsible.astro +28 -0
  32. package/components/ColorPicker.astro +16 -0
  33. package/components/Combobox.astro +67 -0
  34. package/components/Command.astro +33 -0
  35. package/components/ContextMenu.astro +44 -0
  36. package/components/CoverImage.astro +180 -0
  37. package/components/DataTable.astro +122 -0
  38. package/components/DatePicker.astro +108 -0
  39. package/components/DateRangePicker.astro +18 -0
  40. package/components/Descriptions.astro +41 -0
  41. package/components/Dialog.astro +40 -0
  42. package/components/Direction.astro +30 -0
  43. package/components/Drawer.astro +40 -0
  44. package/components/DropdownMenu.astro +40 -0
  45. package/components/Empty.astro +32 -0
  46. package/components/Eyebrow.astro +27 -0
  47. package/components/Field.astro +42 -0
  48. package/components/FileUpload.astro +44 -0
  49. package/components/FloatingBadge.astro +27 -0
  50. package/components/FormattedDate.astro +27 -0
  51. package/components/GradientDivider.astro +24 -0
  52. package/components/HoverCard.astro +40 -0
  53. package/components/Icon.astro +50 -0
  54. package/components/Image.astro +33 -0
  55. package/components/Input.astro +24 -0
  56. package/components/InputGroup.astro +27 -0
  57. package/components/InputOTP.astro +60 -0
  58. package/components/Item.astro +32 -0
  59. package/components/Kbd.astro +27 -0
  60. package/components/Label.astro +18 -0
  61. package/components/LanguageToggle.astro +30 -0
  62. package/components/Link.astro +27 -0
  63. package/components/Marker.astro +33 -0
  64. package/components/Mentions.astro +47 -0
  65. package/components/Menubar.astro +40 -0
  66. package/components/Message.astro +32 -0
  67. package/components/MessageScroller.astro +32 -0
  68. package/components/Meter.astro +31 -0
  69. package/components/NativeSelect.astro +37 -0
  70. package/components/NavigationMenu.astro +40 -0
  71. package/components/Note.astro +23 -0
  72. package/components/NumberField.astro +16 -0
  73. package/components/Pagination.astro +28 -0
  74. package/components/Particles.astro +31 -0
  75. package/components/PhoneInput.astro +86 -0
  76. package/components/Pill.astro +30 -0
  77. package/components/Popconfirm.astro +40 -0
  78. package/components/Popover.astro +40 -0
  79. package/components/Progress.astro +30 -0
  80. package/components/Prose.astro +27 -0
  81. package/components/QRCode.astro +44 -0
  82. package/components/RadioGroup.astro +28 -0
  83. package/components/Rating.astro +42 -0
  84. package/components/Resizable.astro +55 -0
  85. package/components/RevealGroup.astro +54 -0
  86. package/components/RichTextEditor.astro +19 -0
  87. package/components/Schedule.astro +19 -0
  88. package/components/ScrollArea.astro +32 -0
  89. package/components/ScrollReveal.astro +50 -0
  90. package/components/SearchField.astro +16 -0
  91. package/components/Segmented.astro +56 -0
  92. package/components/Select.astro +120 -0
  93. package/components/Separator.astro +31 -0
  94. package/components/Sheet.astro +40 -0
  95. package/components/Sidebar.astro +39 -0
  96. package/components/Skeleton.astro +36 -0
  97. package/components/SkipLink.astro +27 -0
  98. package/components/Slider.astro +20 -0
  99. package/components/Sonner.astro +38 -0
  100. package/components/SpeedDial.astro +77 -0
  101. package/components/Spinner.astro +36 -0
  102. package/components/Stat.astro +34 -0
  103. package/components/Stepper.astro +57 -0
  104. package/components/Switch.astro +23 -0
  105. package/components/Table.astro +32 -0
  106. package/components/Tabs.astro +33 -0
  107. package/components/TagGroup.astro +18 -0
  108. package/components/Textarea.astro +17 -0
  109. package/components/ThemeBuilder.astro +19 -0
  110. package/components/ThemeToggle.astro +41 -0
  111. package/components/TimeField.astro +16 -0
  112. package/components/Timeline.astro +12 -0
  113. package/components/TimelineItem.astro +19 -0
  114. package/components/Toast.astro +50 -0
  115. package/components/Toggle.astro +25 -0
  116. package/components/ToggleGroup.astro +28 -0
  117. package/components/Toolbar.astro +36 -0
  118. package/components/Tooltip.astro +27 -0
  119. package/components/Tour.astro +52 -0
  120. package/components/Transfer.astro +70 -0
  121. package/components/Tree.astro +19 -0
  122. package/components/TreeGrid.astro +19 -0
  123. package/components/TreeSelect.astro +69 -0
  124. package/components/Typography.astro +27 -0
  125. package/components/VirtualList.astro +19 -0
  126. package/components/Watermark.astro +60 -0
  127. package/index.d.ts +125 -0
  128. package/index.ts +125 -0
  129. package/package.json +74 -0
  130. package/runtime/UIPrimitives.astro +4649 -0
  131. package/styles/lumen.css +5 -0
@@ -0,0 +1,23 @@
1
+ ---
2
+ import { resolveLumenAstroProps } from '@santi020k/lumen-core'
3
+
4
+ import type { HTMLAttributes } from 'astro/types'
5
+
6
+ type HTMLInputAttributes = HTMLAttributes<'input'>
7
+
8
+ interface Props extends Omit<HTMLInputAttributes, 'type'> {
9
+ class?: string
10
+ className?: string
11
+ }
12
+
13
+ const { class: classProp = '', className = '', role = 'switch', ...rest } = Astro.props
14
+ const { classList, passthrough } = resolveLumenAstroProps(rest, ['ui-switch'
15
+ ], classProp, className)
16
+ ---
17
+
18
+ <input
19
+ class:list={classList}
20
+ role={role}
21
+ type="checkbox"
22
+ {...passthrough}
23
+ />
@@ -0,0 +1,32 @@
1
+ ---
2
+ import { resolveLumenAstroProps } from '@santi020k/lumen-core'
3
+
4
+ import type { HTMLAttributes } from 'astro/types'
5
+
6
+ interface Props extends HTMLAttributes<'div'> {
7
+ class?: string
8
+ className?: string
9
+ glass?: boolean | 'subtle' | 'strong'
10
+ }
11
+
12
+ const {
13
+ class: classProp = '',
14
+ className = '',
15
+ glass = false,
16
+ ...rest
17
+ } = Astro.props
18
+
19
+ const { classList, passthrough } = resolveLumenAstroProps(rest, [
20
+ 'ui-table-wrap',
21
+ glass && 'ui-table-wrap--glass',
22
+ glass === 'subtle' && 'ui-glass-subtle',
23
+ glass === 'strong' && 'ui-glass-strong'
24
+ ], classProp, className)
25
+ ---
26
+
27
+ <div
28
+ class:list={classList}
29
+ {...passthrough}
30
+ >
31
+ <slot />
32
+ </div>
@@ -0,0 +1,33 @@
1
+ ---
2
+ import { resolveLumenAstroProps } from '@santi020k/lumen-core'
3
+
4
+ import type { HTMLAttributes } from 'astro/types'
5
+
6
+ interface Props extends HTMLAttributes<'div'> {
7
+ class?: string
8
+ className?: string
9
+ glass?: boolean | 'subtle' | 'strong'
10
+ }
11
+
12
+ const {
13
+ class: classProp = '',
14
+ className = '',
15
+ glass = false,
16
+ ...rest
17
+ } = Astro.props
18
+
19
+ const { classList, passthrough } = resolveLumenAstroProps(rest, [
20
+ 'ui-tabs',
21
+ glass && 'ui-tabs--glass',
22
+ glass === 'subtle' && 'ui-glass-subtle',
23
+ glass === 'strong' && 'ui-glass-strong'
24
+ ], classProp, className)
25
+ ---
26
+
27
+ <div
28
+ data-ui-tabs
29
+ class:list={classList}
30
+ {...passthrough}
31
+ >
32
+ <slot />
33
+ </div>
@@ -0,0 +1,18 @@
1
+ ---
2
+ import { resolveLumenAstroProps } from '@santi020k/lumen-core'
3
+
4
+ import type { HTMLAttributes } from 'astro/types'
5
+
6
+ interface Props extends HTMLAttributes<'div'> {
7
+ class?: string
8
+ className?: string
9
+ }
10
+
11
+ const { class: classProp = '', className = '', ...rest } = Astro.props
12
+ const { classList, passthrough } = resolveLumenAstroProps(rest, ['ui-tag-group'
13
+ ], classProp, className)
14
+ ---
15
+
16
+ <div class:list={classList} role="list" {...passthrough}>
17
+ <slot />
18
+ </div>
@@ -0,0 +1,17 @@
1
+ ---
2
+ import { resolveLumenAstroProps } from '@santi020k/lumen-core'
3
+
4
+ import type { HTMLAttributes } from 'astro/types'
5
+
6
+ interface Props extends HTMLAttributes<'textarea'> {
7
+ class?: string
8
+ className?: string
9
+ }
10
+
11
+ const { class: classProp = '', className = '', rows = 4, ...rest } = Astro.props
12
+ const { classList, passthrough } = resolveLumenAstroProps(rest, ['ui-textarea'
13
+ ], classProp, className)
14
+ ---
15
+
16
+ {/* Slot must stay inline: whitespace inside <textarea> becomes its value and hides the placeholder. */}
17
+ <textarea class:list={classList} rows={rows} {...passthrough}><slot /></textarea>
@@ -0,0 +1,19 @@
1
+ ---
2
+ import { resolveLumenAstroProps } from '@santi020k/lumen-core'
3
+
4
+ import type { HTMLAttributes } from 'astro/types'
5
+
6
+ interface Props extends HTMLAttributes<'section'> {
7
+ class?: string
8
+ className?: string
9
+ glass?: boolean | 'subtle' | 'strong'
10
+ }
11
+
12
+ const { class: classProp = '', className = '', glass = false, ...rest } = Astro.props
13
+ const { classList, passthrough } = resolveLumenAstroProps(rest, ['ui-theme-builder', glass && 'ui-theme-builder--glass', glass === 'subtle' && 'ui-glass-subtle', glass === 'strong' && 'ui-glass-strong'
14
+ ], classProp, className)
15
+ ---
16
+
17
+ <section class:list={classList} data-ui-theme-builder {...passthrough}>
18
+ <slot />
19
+ </section>
@@ -0,0 +1,41 @@
1
+ ---
2
+ import { resolveLumenAstroProps } from '@santi020k/lumen-core'
3
+ import Icon from './Icon.astro'
4
+
5
+ import type { HTMLAttributes } from 'astro/types'
6
+
7
+ interface Props extends HTMLAttributes<'button'> {
8
+ class?: string
9
+ className?: string
10
+ }
11
+
12
+ const {
13
+ class: classProp = '',
14
+ className = '',
15
+ type = 'button',
16
+ ...rest
17
+ } = Astro.props
18
+
19
+ const { classList, passthrough } = resolveLumenAstroProps(rest, [
20
+ 'ui-theme-toggle'
21
+ ], classProp, className)
22
+ ---
23
+
24
+ <button
25
+ type={type}
26
+ class:list={classList}
27
+ data-ui-theme-toggle
28
+ {...passthrough}
29
+ >
30
+ <span class="ui-sr-only">Toggle color theme</span>
31
+ <Icon
32
+ aria-hidden="true"
33
+ class="ui-theme-toggle__sun"
34
+ name="sun"
35
+ />
36
+ <Icon
37
+ aria-hidden="true"
38
+ class="ui-theme-toggle__moon"
39
+ name="moon"
40
+ />
41
+ </button>
@@ -0,0 +1,16 @@
1
+ ---
2
+ import { resolveLumenAstroProps } from '@santi020k/lumen-core'
3
+
4
+ import type { HTMLAttributes } from 'astro/types'
5
+
6
+ interface Props extends HTMLAttributes<'input'> {
7
+ class?: string
8
+ className?: string
9
+ }
10
+
11
+ const { class: classProp = '', className = '', type = 'time', ...rest } = Astro.props
12
+ const { classList, passthrough } = resolveLumenAstroProps(rest, ['ui-input', 'ui-time-field'
13
+ ], classProp, className)
14
+ ---
15
+
16
+ <input class:list={classList} type={type} {...passthrough} />
@@ -0,0 +1,12 @@
1
+ ---
2
+ import type { HTMLAttributes } from 'astro/types'
3
+ import { composeClassName } from '@santi020k/lumen-core'
4
+
5
+ export interface Props extends HTMLAttributes<'ol'> {}
6
+
7
+ const { class: className, ...props } = Astro.props
8
+ ---
9
+
10
+ <ol class={composeClassName('ui-timeline', className)} {...props}>
11
+ <slot />
12
+ </ol>
@@ -0,0 +1,19 @@
1
+ ---
2
+ import type { HTMLAttributes } from 'astro/types'
3
+ import { composeClassName } from '@santi020k/lumen-core'
4
+
5
+ export interface Props extends HTMLAttributes<'li'> {}
6
+
7
+ const { class: className, ...props } = Astro.props
8
+ const hasDot = Astro.slots.has('dot')
9
+ ---
10
+
11
+ <li class={composeClassName('ui-timeline-item', className)} {...props}>
12
+ <div class="ui-timeline-item__tail"></div>
13
+ <div class="ui-timeline-item__dot">
14
+ {hasDot ? <slot name="dot" /> : null}
15
+ </div>
16
+ <div class="ui-timeline-item__content">
17
+ <slot />
18
+ </div>
19
+ </li>
@@ -0,0 +1,50 @@
1
+ ---
2
+ import { resolveLumenAstroProps, resolveLumenGlass } from '@santi020k/lumen-core'
3
+
4
+ import type { HTMLAttributes } from 'astro/types'
5
+
6
+ interface Props extends HTMLAttributes<'aside'> {
7
+ class?: string
8
+ className?: string
9
+ glass?: boolean | 'subtle' | 'strong'
10
+ /**
11
+ * @deprecated Use `glass` instead. `surface="glass"` maps to `glass={true}`.
12
+ */
13
+ surface?: 'default' | 'glass'
14
+ variant?: 'default' | 'destructive' | 'success' | 'warning'
15
+ }
16
+
17
+ const {
18
+ 'aria-live': ariaLive,
19
+ class: classProp = '',
20
+ className = '',
21
+ glass = false,
22
+ role,
23
+ surface = 'default',
24
+ variant = 'default',
25
+ ...rest
26
+ } = Astro.props
27
+
28
+ const resolvedGlass = resolveLumenGlass(glass, surface)
29
+ const { classList, passthrough } = resolveLumenAstroProps(rest, [
30
+ 'ui-toast',
31
+ variant === 'destructive' && 'ui-toast--destructive',
32
+ variant === 'success' && 'ui-toast--success',
33
+ variant === 'warning' && 'ui-toast--warning',
34
+ resolvedGlass && 'ui-toast--glass',
35
+ glass === 'subtle' && 'ui-glass-subtle',
36
+ glass === 'strong' && 'ui-glass-strong'
37
+ ], classProp, className)
38
+ ---
39
+
40
+ <aside
41
+ data-surface={resolvedGlass ? 'glass' : 'default'}
42
+ data-ui-toast
43
+ data-variant={variant}
44
+ aria-live={ariaLive ?? (variant === 'destructive' ? 'assertive' : 'polite')}
45
+ class:list={classList}
46
+ role={role ?? (variant === 'destructive' ? 'alert' : 'status')}
47
+ {...passthrough}
48
+ >
49
+ <slot />
50
+ </aside>
@@ -0,0 +1,25 @@
1
+ ---
2
+ import { resolveLumenAstroProps } from '@santi020k/lumen-core'
3
+
4
+ import type { HTMLAttributes } from 'astro/types'
5
+
6
+ interface Props extends HTMLAttributes<'button'> {
7
+ class?: string
8
+ className?: string
9
+ pressed?: boolean
10
+ }
11
+
12
+ const { class: classProp = '', className = '', pressed = false, type = 'button', ...rest } = Astro.props
13
+ const { classList, passthrough } = resolveLumenAstroProps(rest, ['ui-toggle', pressed && 'ui-toggle--pressed'
14
+ ], classProp, className)
15
+ ---
16
+
17
+ <button
18
+ aria-pressed={pressed}
19
+ class:list={classList}
20
+ data-ui-toggle
21
+ type={type}
22
+ {...passthrough}
23
+ >
24
+ <slot />
25
+ </button>
@@ -0,0 +1,28 @@
1
+ ---
2
+ import { resolveLumenAstroProps } from '@santi020k/lumen-core'
3
+
4
+ import type { HTMLAttributes } from 'astro/types'
5
+
6
+ interface Props extends HTMLAttributes<'div'> {
7
+ class?: string
8
+ className?: string
9
+ }
10
+
11
+ const {
12
+ class: classProp = '',
13
+ className = '',
14
+ ...rest
15
+ } = Astro.props
16
+
17
+ const { classList, passthrough } = resolveLumenAstroProps(rest, [
18
+ 'ui-toggle-group'
19
+ ], classProp, className)
20
+ ---
21
+
22
+ <div
23
+ data-ui-toggle-group
24
+ class:list={classList}
25
+ {...passthrough}
26
+ >
27
+ <slot />
28
+ </div>
@@ -0,0 +1,36 @@
1
+ ---
2
+ import { resolveLumenAstroProps } from '@santi020k/lumen-core'
3
+
4
+ import type { HTMLAttributes } from 'astro/types'
5
+
6
+ interface Props extends HTMLAttributes<'div'> {
7
+ class?: string
8
+ className?: string
9
+ orientation?: 'horizontal' | 'vertical'
10
+ }
11
+
12
+ const {
13
+ 'aria-label': ariaLabel = 'Toolbar',
14
+ class: classProp = '',
15
+ className = '',
16
+ orientation = 'horizontal',
17
+ ...rest
18
+ } = Astro.props
19
+
20
+ const { classList, passthrough } = resolveLumenAstroProps(rest, [
21
+ 'ui-toolbar',
22
+ orientation === 'vertical' && 'ui-toolbar--vertical'
23
+ ], classProp, className)
24
+ ---
25
+
26
+ <div
27
+ aria-label={ariaLabel}
28
+ aria-orientation={orientation}
29
+ class:list={classList}
30
+ data-ui-toolbar
31
+ data-orientation={orientation}
32
+ role="toolbar"
33
+ {...passthrough}
34
+ >
35
+ <slot />
36
+ </div>
@@ -0,0 +1,27 @@
1
+ ---
2
+ import { resolveLumenAstroProps } from '@santi020k/lumen-core'
3
+
4
+ import type { HTMLAttributes } from 'astro/types'
5
+
6
+ interface Props extends HTMLAttributes<'span'> {
7
+ class?: string
8
+ className?: string
9
+ }
10
+
11
+ const {
12
+ class: classProp = '',
13
+ className = '',
14
+ ...rest
15
+ } = Astro.props
16
+
17
+ const { classList, passthrough } = resolveLumenAstroProps(rest, [
18
+ 'ui-tooltip'
19
+ ], classProp, className)
20
+ ---
21
+
22
+ <span
23
+ class:list={classList}
24
+ {...passthrough}
25
+ >
26
+ <slot />
27
+ </span>
@@ -0,0 +1,52 @@
1
+ ---
2
+ import { resolveLumenAstroProps } from '@santi020k/lumen-core'
3
+
4
+ import type { HTMLAttributes } from 'astro/types'
5
+
6
+ type TourStep = { content: string; target: string; title?: string }
7
+
8
+ interface Props extends HTMLAttributes<'div'> {
9
+ class?: string
10
+ className?: string
11
+ closeLabel?: string
12
+ nextLabel?: string
13
+ steps?: TourStep[]
14
+ }
15
+
16
+ const {
17
+ class: classProp = '',
18
+ className = '',
19
+ closeLabel = 'Done',
20
+ nextLabel = 'Next',
21
+ steps = [],
22
+ ...rest
23
+ } = Astro.props
24
+
25
+ const { classList, passthrough } = resolveLumenAstroProps(rest, [
26
+ 'ui-tour'
27
+ ], classProp, className)
28
+ ---
29
+
30
+ <div
31
+ class:list={classList}
32
+ data-ui-tour
33
+ hidden
34
+ {...passthrough}
35
+ >
36
+ <div aria-hidden="true" class="ui-tour__backdrop" data-ui-tour-backdrop></div>
37
+ <div class="ui-tour__popover" data-ui-tour-popover role="dialog" aria-modal="false">
38
+ {steps.map((step, index) => (
39
+ <div class="ui-tour__step" data-target={step.target} data-ui-tour-step hidden={index !== 0}>
40
+ {step.title && <p class="ui-tour__title">{step.title}</p>}
41
+ <p class="ui-tour__content">{step.content}</p>
42
+ <div class="ui-tour__actions">
43
+ <button class="ui-button ui-button--ghost ui-button--sm" data-ui-tour-close type="button">{closeLabel}</button>
44
+ {index < steps.length - 1 && (
45
+ <button class="ui-button ui-button--default ui-button--sm" data-ui-tour-next type="button">{nextLabel}</button>
46
+ )}
47
+ </div>
48
+ </div>
49
+ ))}
50
+ <slot />
51
+ </div>
52
+ </div>
@@ -0,0 +1,70 @@
1
+ ---
2
+ import { resolveLumenAstroProps } from '@santi020k/lumen-core'
3
+ import Icon from './Icon.astro'
4
+
5
+ import type { HTMLAttributes } from 'astro/types'
6
+
7
+ type TransferItem = { key: string; label: string }
8
+
9
+ interface Props extends HTMLAttributes<'div'> {
10
+ class?: string
11
+ className?: string
12
+ items?: TransferItem[]
13
+ name?: string
14
+ sourceTitle?: string
15
+ targetItems?: TransferItem[]
16
+ targetTitle?: string
17
+ }
18
+
19
+ const {
20
+ class: classProp = '',
21
+ className = '',
22
+ items = [],
23
+ name,
24
+ sourceTitle = 'Available',
25
+ targetItems = [],
26
+ targetTitle = 'Selected',
27
+ ...rest
28
+ } = Astro.props
29
+
30
+ const { classList, passthrough } = resolveLumenAstroProps(rest, [
31
+ 'ui-transfer'
32
+ ], classProp, className)
33
+ ---
34
+
35
+ <div class:list={classList} data-ui-transfer data-ui-transfer-name={name} {...passthrough}>
36
+ <div class="ui-transfer__panel">
37
+ <p class="ui-transfer__title">{sourceTitle}</p>
38
+ <ul class="ui-transfer__list" data-side="source" data-ui-transfer-list>
39
+ {items.map(item => (
40
+ <li class="ui-transfer__item">
41
+ <label class="ui-transfer__option">
42
+ <input class="ui-checkbox" data-ui-transfer-item type="checkbox" value={item.key} />
43
+ <span>{item.label}</span>
44
+ </label>
45
+ </li>
46
+ ))}
47
+ </ul>
48
+ </div>
49
+ <div class="ui-transfer__controls">
50
+ <button aria-label={`Move to ${targetTitle}`} class="ui-button ui-button--outline ui-button--icon" data-ui-transfer-move="target" type="button">
51
+ <Icon name="chevron-right" />
52
+ </button>
53
+ <button aria-label={`Move to ${sourceTitle}`} class="ui-button ui-button--outline ui-button--icon" data-ui-transfer-move="source" type="button">
54
+ <Icon name="chevron-left" />
55
+ </button>
56
+ </div>
57
+ <div class="ui-transfer__panel">
58
+ <p class="ui-transfer__title">{targetTitle}</p>
59
+ <ul class="ui-transfer__list" data-side="target" data-ui-transfer-list>
60
+ {targetItems.map(item => (
61
+ <li class="ui-transfer__item">
62
+ <label class="ui-transfer__option">
63
+ <input class="ui-checkbox" data-ui-transfer-item type="checkbox" value={item.key} />
64
+ <span>{item.label}</span>
65
+ </label>
66
+ </li>
67
+ ))}
68
+ </ul>
69
+ </div>
70
+ </div>
@@ -0,0 +1,19 @@
1
+ ---
2
+ import { resolveLumenAstroProps } from '@santi020k/lumen-core'
3
+
4
+ import type { HTMLAttributes } from 'astro/types'
5
+
6
+ interface Props extends HTMLAttributes<'div'> {
7
+ class?: string
8
+ className?: string
9
+ glass?: boolean | 'subtle' | 'strong'
10
+ }
11
+
12
+ const { class: classProp = '', className = '', glass = false, ...rest } = Astro.props
13
+ const { classList, passthrough } = resolveLumenAstroProps(rest, ['ui-tree', glass && 'ui-tree--glass', glass === 'subtle' && 'ui-glass-subtle', glass === 'strong' && 'ui-glass-strong'
14
+ ], classProp, className)
15
+ ---
16
+
17
+ <div class:list={classList} role="tree" {...passthrough}>
18
+ <slot />
19
+ </div>
@@ -0,0 +1,19 @@
1
+ ---
2
+ import { resolveLumenAstroProps } from '@santi020k/lumen-core'
3
+
4
+ import type { HTMLAttributes } from 'astro/types'
5
+
6
+ interface Props extends HTMLAttributes<'div'> {
7
+ class?: string
8
+ className?: string
9
+ glass?: boolean | 'subtle' | 'strong'
10
+ }
11
+
12
+ const { class: classProp = '', className = '', glass = false, ...rest } = Astro.props
13
+ const { classList, passthrough } = resolveLumenAstroProps(rest, ['ui-tree-grid', glass && 'ui-tree-grid--glass', glass === 'subtle' && 'ui-glass-subtle', glass === 'strong' && 'ui-glass-strong'
14
+ ], classProp, className)
15
+ ---
16
+
17
+ <div class:list={classList} role="treegrid" {...passthrough}>
18
+ <slot />
19
+ </div>
@@ -0,0 +1,69 @@
1
+ ---
2
+ import { resolveLumenAstroProps } from '@santi020k/lumen-core'
3
+
4
+ import type { HTMLAttributes } from 'astro/types'
5
+
6
+ interface TreeNode {
7
+ children?: TreeNode[]
8
+ label: string
9
+ value: string
10
+ }
11
+
12
+ interface Props extends HTMLAttributes<'div'> {
13
+ class?: string
14
+ className?: string
15
+ name?: string
16
+ placeholder?: string
17
+ treeData?: TreeNode[]
18
+ }
19
+
20
+ const {
21
+ class: classProp = '',
22
+ className = '',
23
+ name,
24
+ placeholder = 'Select…',
25
+ treeData = [],
26
+ ...rest
27
+ } = Astro.props
28
+
29
+ const flatten = (nodes: TreeNode[], depth = 0, acc: { depth: number; label: string; value: string }[] = []) => {
30
+ for (const node of nodes) {
31
+ acc.push({ depth, label: node.label, value: node.value })
32
+
33
+ if (node.children && node.children.length > 0) {
34
+ flatten(node.children, depth + 1, acc)
35
+ }
36
+ }
37
+
38
+ return acc
39
+ }
40
+
41
+ const rows = flatten(treeData)
42
+
43
+ const { classList, passthrough } = resolveLumenAstroProps(rest, [
44
+ 'ui-tree-select'
45
+ ], classProp, className)
46
+ ---
47
+
48
+ <div class:list={classList} data-surface="default" data-ui-popover data-ui-tree-select {...passthrough}>
49
+ <button aria-expanded="false" aria-haspopup="tree" class="ui-select ui-select__trigger ui-tree-select__trigger" data-ui-trigger type="button">
50
+ <span data-ui-tree-select-placeholder={placeholder} data-ui-tree-select-value>{placeholder}</span>
51
+ </button>
52
+ <div class="ui-tree-select__panel" data-ui-panel hidden>
53
+ <div class="ui-tree-select__tree" role="tree">
54
+ {rows.map(row => (
55
+ <button
56
+ class="ui-tree-select__option"
57
+ data-value={row.value}
58
+ role="treeitem"
59
+ style={`--ui-tree-depth:${row.depth}`}
60
+ type="button"
61
+ >
62
+ {row.label}
63
+ </button>
64
+ ))}
65
+ </div>
66
+ <slot />
67
+ </div>
68
+ {name && <input data-ui-tree-select-input name={name} type="hidden" />}
69
+ </div>
@@ -0,0 +1,27 @@
1
+ ---
2
+ import { resolveLumenAstroProps } from '@santi020k/lumen-core'
3
+
4
+ import type { HTMLAttributes } from 'astro/types'
5
+
6
+ interface Props extends HTMLAttributes<'div'> {
7
+ class?: string
8
+ className?: string
9
+ }
10
+
11
+ const {
12
+ class: classProp = '',
13
+ className = '',
14
+ ...rest
15
+ } = Astro.props
16
+
17
+ const { classList, passthrough } = resolveLumenAstroProps(rest, [
18
+ 'ui-typography'
19
+ ], classProp, className)
20
+ ---
21
+
22
+ <div
23
+ class:list={classList}
24
+ {...passthrough}
25
+ >
26
+ <slot />
27
+ </div>