@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,40 @@
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
+ }
15
+
16
+ const {
17
+ class: classProp = '',
18
+ className = '',
19
+ glass = false,
20
+ surface = 'default',
21
+ ...rest
22
+ } = Astro.props
23
+
24
+ const resolvedGlass = resolveLumenGlass(glass, surface)
25
+ const { classList, passthrough } = resolveLumenAstroProps(rest, [
26
+ 'ui-hover-card',
27
+ resolvedGlass && 'ui-hover-card--glass',
28
+ glass === 'subtle' && 'ui-glass-subtle',
29
+ glass === 'strong' && 'ui-glass-strong'
30
+ ], classProp, className)
31
+ ---
32
+
33
+ <aside
34
+ data-surface={resolvedGlass ? 'glass' : 'default'}
35
+ data-ui-hover-card
36
+ class:list={classList}
37
+ {...passthrough}
38
+ >
39
+ <slot />
40
+ </aside>
@@ -0,0 +1,50 @@
1
+ ---
2
+ import {
3
+ renderLumenIconSvg,
4
+ resolveLumenAstroProps,
5
+ type LumenIconName
6
+ } from '@santi020k/lumen-core'
7
+
8
+ import type { HTMLAttributes } from 'astro/types'
9
+
10
+ type IconSize = 'default' | 'lg' | 'sm' | 'xl'
11
+
12
+ interface Props extends HTMLAttributes<'span'> {
13
+ class?: string
14
+ className?: string
15
+ decorative?: boolean
16
+ label?: string
17
+ name?: LumenIconName
18
+ size?: IconSize
19
+ }
20
+
21
+ const {
22
+ class: classProp = '',
23
+ className = '',
24
+ decorative,
25
+ label,
26
+ name,
27
+ size = 'default',
28
+ ...rest
29
+ } = Astro.props
30
+
31
+ const isDecorative = decorative ?? !label
32
+ const iconSvg = name ? renderLumenIconSvg(name) : ''
33
+
34
+ const { classList, passthrough } = resolveLumenAstroProps(rest, [
35
+ 'ui-icon',
36
+ size === 'sm' && 'ui-icon--sm',
37
+ size === 'lg' && 'ui-icon--lg',
38
+ size === 'xl' && 'ui-icon--xl'
39
+ ], classProp, className)
40
+ ---
41
+
42
+ <span
43
+ aria-hidden={isDecorative ? 'true' : undefined}
44
+ aria-label={!isDecorative ? label : undefined}
45
+ class:list={classList}
46
+ role={!isDecorative ? 'img' : undefined}
47
+ {...passthrough}
48
+ >
49
+ {name ? <Fragment set:html={iconSvg} /> : <slot />}
50
+ </span>
@@ -0,0 +1,33 @@
1
+ ---
2
+ import { resolveLumenAstroProps } from '@santi020k/lumen-core'
3
+ import {
4
+ Image as AstroImage,
5
+ type LocalImageProps,
6
+ type RemoteImageProps
7
+ } from 'astro:assets'
8
+
9
+ type Props = (LocalImageProps | RemoteImageProps) & {
10
+ class?: string
11
+ className?: string
12
+ invertOnDark?: boolean
13
+ }
14
+
15
+ const {
16
+ class: classProp = '',
17
+ className = '',
18
+ invertOnDark = false,
19
+ loading = 'lazy',
20
+ ...rest
21
+ } = Astro.props
22
+
23
+ const { classList, passthrough } = resolveLumenAstroProps(rest, [
24
+ 'ui-image',
25
+ invertOnDark && 'ui-image--invert-dark'
26
+ ], classProp, className)
27
+ ---
28
+
29
+ <AstroImage
30
+ loading={loading}
31
+ class:list={classList}
32
+ {...passthrough}
33
+ />
@@ -0,0 +1,24 @@
1
+ ---
2
+ import { resolveLumenAstroProps } from '@santi020k/lumen-core'
3
+
4
+ import type { HTMLAttributes } from 'astro/types'
5
+
6
+ interface Props extends Omit<HTMLAttributes<'input'>, 'size'> {
7
+ class?: string
8
+ className?: string
9
+ size?: 'default' | 'lg' | 'sm'
10
+ }
11
+
12
+ const { class: classProp = '', className = '', size = 'default', type = 'text', ...rest } = Astro.props
13
+ const { classList, passthrough } = resolveLumenAstroProps(rest, [
14
+ 'ui-input',
15
+ size === 'sm' && 'ui-input--sm',
16
+ size === 'lg' && 'ui-input--lg'
17
+ ], classProp, className)
18
+ ---
19
+
20
+ <input
21
+ class:list={classList}
22
+ type={type}
23
+ {...passthrough}
24
+ />
@@ -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-input-group'
19
+ ], classProp, className)
20
+ ---
21
+
22
+ <div
23
+ class:list={classList}
24
+ {...passthrough}
25
+ >
26
+ <slot />
27
+ </div>
@@ -0,0 +1,60 @@
1
+ ---
2
+ import { resolveLumenAstroProps } from '@santi020k/lumen-core'
3
+
4
+ import type { HTMLAttributes } from 'astro/types'
5
+
6
+ interface Props extends Omit<HTMLAttributes<'input'>, 'size'> {
7
+ class?: string
8
+ className?: string
9
+ length?: number
10
+ }
11
+
12
+ const {
13
+ autocomplete = 'one-time-code',
14
+ class: classProp = '',
15
+ className = '',
16
+ disabled = false,
17
+ inputmode = 'numeric',
18
+ length = 6,
19
+ maxlength = length,
20
+ pattern = '[0-9]*',
21
+ ...rest
22
+ } = Astro.props
23
+ const { classList, passthrough } = resolveLumenAstroProps(rest, ['ui-input-otp-field'
24
+ ], classProp, className)
25
+ const segments = Array.from({ length: Math.max(1, Number(length) || 6) }, (_, index) => index)
26
+ ---
27
+
28
+ <div
29
+ class:list={classList}
30
+ data-ui-input-otp
31
+ data-ui-input-otp-length={segments.length}
32
+ >
33
+ <input
34
+ autocomplete={autocomplete}
35
+ class="ui-input-otp ui-input-otp__native"
36
+ data-ui-input-otp-native
37
+ disabled={disabled}
38
+ inputmode={inputmode}
39
+ maxlength={maxlength}
40
+ pattern={pattern}
41
+ type="text"
42
+ {...passthrough}
43
+ />
44
+
45
+ <div class="ui-input-otp__segments" data-ui-input-otp-segments hidden>
46
+ {segments.map(index => (
47
+ <button
48
+ aria-hidden="true"
49
+ class="ui-input-otp__segment"
50
+ data-index={index}
51
+ data-ui-input-otp-segment
52
+ disabled={disabled}
53
+ tabindex="-1"
54
+ type="button"
55
+ >
56
+ <span data-ui-input-otp-char>&nbsp;</span>
57
+ </button>
58
+ ))}
59
+ </div>
60
+ </div>
@@ -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-item',
21
+ glass && 'ui-item--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,27 @@
1
+ ---
2
+ import { resolveLumenAstroProps } from '@santi020k/lumen-core'
3
+
4
+ import type { HTMLAttributes } from 'astro/types'
5
+
6
+ interface Props extends HTMLAttributes<'kbd'> {
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-kbd'
19
+ ], classProp, className)
20
+ ---
21
+
22
+ <kbd
23
+ class:list={classList}
24
+ {...passthrough}
25
+ >
26
+ <slot />
27
+ </kbd>
@@ -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<'label'> {
7
+ class?: string
8
+ className?: string
9
+ }
10
+
11
+ const { class: classProp = '', className = '', ...rest } = Astro.props
12
+ const { classList, passthrough } = resolveLumenAstroProps(rest, ['ui-label'
13
+ ], classProp, className)
14
+ ---
15
+
16
+ <label class:list={classList} {...passthrough}>
17
+ <slot />
18
+ </label>
@@ -0,0 +1,30 @@
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
+ }
10
+
11
+ const {
12
+ class: classProp = '',
13
+ className = '',
14
+ type = 'button',
15
+ ...rest
16
+ } = Astro.props
17
+
18
+ const { classList, passthrough } = resolveLumenAstroProps(rest, [
19
+ 'ui-language-toggle'
20
+ ], classProp, className)
21
+ ---
22
+
23
+ <button
24
+ type={type}
25
+ class:list={classList}
26
+ data-ui-language-toggle
27
+ {...passthrough}
28
+ >
29
+ <slot />
30
+ </button>
@@ -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<'a'> {
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-link'
19
+ ], classProp, className)
20
+ ---
21
+
22
+ <a
23
+ class:list={classList}
24
+ {...passthrough}
25
+ >
26
+ <slot />
27
+ </a>
@@ -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<'span'> {
7
+ class?: string
8
+ className?: string
9
+ variant?: 'default' | 'success' | 'warning' | 'danger'
10
+ }
11
+
12
+ const {
13
+ class: classProp = '',
14
+ className = '',
15
+ variant = 'default',
16
+ ...rest
17
+ } = Astro.props
18
+
19
+ const { classList, passthrough } = resolveLumenAstroProps(rest, [
20
+ 'ui-marker',
21
+ variant === 'success' && 'ui-marker--success',
22
+ variant === 'warning' && 'ui-marker--warning',
23
+ variant === 'danger' && 'ui-marker--danger'
24
+ ], classProp, className)
25
+ ---
26
+
27
+ <span
28
+ data-variant={variant}
29
+ class:list={classList}
30
+ {...passthrough}
31
+ >
32
+ <slot />
33
+ </span>
@@ -0,0 +1,47 @@
1
+ ---
2
+ import { resolveLumenAstroProps } from '@santi020k/lumen-core'
3
+
4
+ import type { HTMLAttributes } from 'astro/types'
5
+
6
+ type MentionOption = string | { label: string; value: string }
7
+
8
+ interface Props extends HTMLAttributes<'div'> {
9
+ class?: string
10
+ className?: string
11
+ name?: string
12
+ options?: MentionOption[]
13
+ placeholder?: string
14
+ trigger?: string
15
+ }
16
+
17
+ const {
18
+ class: classProp = '',
19
+ className = '',
20
+ name,
21
+ options = [],
22
+ placeholder,
23
+ trigger = '@',
24
+ ...rest
25
+ } = Astro.props
26
+
27
+ const normalized = options.map(option =>
28
+ typeof option === 'string' ? { label: option, value: option } : option
29
+ )
30
+
31
+ const { classList, passthrough } = resolveLumenAstroProps(rest, [
32
+ 'ui-mentions'
33
+ ], classProp, className)
34
+ ---
35
+
36
+ <div class:list={classList} data-ui-mentions data-ui-mentions-trigger={trigger} {...passthrough}>
37
+ <textarea class="ui-textarea ui-mentions__input" data-ui-mentions-input name={name} placeholder={placeholder} rows={3}></textarea>
38
+ <ul class="ui-mentions__list" data-ui-mentions-list hidden role="listbox">
39
+ {normalized.map(option => (
40
+ <li>
41
+ <button class="ui-mentions__option" data-ui-mentions-option data-value={option.value} role="option" type="button">
42
+ {option.label}
43
+ </button>
44
+ </li>
45
+ ))}
46
+ </ul>
47
+ </div>
@@ -0,0 +1,40 @@
1
+ ---
2
+ import { resolveLumenAstroProps, resolveLumenGlass } from '@santi020k/lumen-core'
3
+
4
+ import type { HTMLAttributes } from 'astro/types'
5
+
6
+ interface Props extends HTMLAttributes<'nav'> {
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
+ }
15
+
16
+ const {
17
+ class: classProp = '',
18
+ className = '',
19
+ glass = false,
20
+ surface = 'default',
21
+ ...rest
22
+ } = Astro.props
23
+
24
+ const resolvedGlass = resolveLumenGlass(glass, surface)
25
+ const { classList, passthrough } = resolveLumenAstroProps(rest, [
26
+ 'ui-menubar',
27
+ resolvedGlass && 'ui-menubar--glass',
28
+ glass === 'subtle' && 'ui-glass-subtle',
29
+ glass === 'strong' && 'ui-glass-strong'
30
+ ], classProp, className)
31
+ ---
32
+
33
+ <nav
34
+ data-surface={resolvedGlass ? 'glass' : 'default'}
35
+ data-ui-menubar
36
+ class:list={classList}
37
+ {...passthrough}
38
+ >
39
+ <slot />
40
+ </nav>
@@ -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<'article'> {
7
+ class?: string
8
+ className?: string
9
+ from?: 'user' | 'assistant'
10
+ }
11
+
12
+ const {
13
+ class: classProp = '',
14
+ className = '',
15
+ from = 'assistant',
16
+ ...rest
17
+ } = Astro.props
18
+
19
+ const { classList, passthrough } = resolveLumenAstroProps(rest, [
20
+ 'ui-message',
21
+ from === 'user' && 'ui-message--user',
22
+ from === 'assistant' && 'ui-message--assistant'
23
+ ], classProp, className)
24
+ ---
25
+
26
+ <article
27
+ data-from={from}
28
+ class:list={classList}
29
+ {...passthrough}
30
+ >
31
+ <slot />
32
+ </article>
@@ -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-message-scroller',
21
+ glass && 'ui-message-scroller--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,31 @@
1
+ ---
2
+ import type { HTMLAttributes } from 'astro/types'
3
+ import { composeClassName } from '@santi020k/lumen-core'
4
+
5
+ export interface Props extends HTMLAttributes<'meter'> {
6
+ value: number
7
+ min?: number
8
+ max?: number
9
+ low?: number
10
+ high?: number
11
+ optimum?: number
12
+ }
13
+
14
+ const {
15
+ class: className,
16
+ value,
17
+ min = 0,
18
+ max = 100,
19
+ ...props
20
+ } = Astro.props
21
+ ---
22
+
23
+ <meter
24
+ class={composeClassName('ui-meter', className)}
25
+ value={value}
26
+ min={min}
27
+ max={max}
28
+ {...props}
29
+ >
30
+ <slot>{value}</slot>
31
+ </meter>
@@ -0,0 +1,37 @@
1
+ ---
2
+ import { resolveLumenAstroProps } from '@santi020k/lumen-core'
3
+
4
+ import type { HTMLAttributes } from 'astro/types'
5
+
6
+ interface Option {
7
+ disabled?: boolean
8
+ label: string
9
+ value: string
10
+ }
11
+
12
+ type SelectOption = Option | string
13
+
14
+ interface Props extends Omit<HTMLAttributes<'select'>, 'size'> {
15
+ class?: string
16
+ className?: string
17
+ size?: 'default' | 'lg' | 'sm'
18
+ options?: SelectOption[]
19
+ placeholder?: string
20
+ }
21
+
22
+ const { class: classProp = '', className = '', options = [], placeholder, size = 'default', ...rest } = Astro.props
23
+ const hasValue = Object.hasOwn(rest, 'value')
24
+ const normalizedOptions = options.map(option =>
25
+ typeof option === 'string' ? { label: option, value: option } : option
26
+ )
27
+ const { classList, passthrough } = resolveLumenAstroProps(rest, ['ui-select', size === 'sm' && 'ui-select--sm', size === 'lg' && 'ui-select--lg'
28
+ ], classProp, className)
29
+ ---
30
+
31
+ <select class:list={classList} {...passthrough}>
32
+ {placeholder && <option disabled selected={!hasValue} value="">{placeholder}</option>}
33
+ <slot />
34
+ {normalizedOptions.map(option => (
35
+ <option disabled={option.disabled} value={option.value}>{option.label}</option>
36
+ ))}
37
+ </select>
@@ -0,0 +1,40 @@
1
+ ---
2
+ import { resolveLumenAstroProps, resolveLumenGlass } from '@santi020k/lumen-core'
3
+
4
+ import type { HTMLAttributes } from 'astro/types'
5
+
6
+ interface Props extends HTMLAttributes<'nav'> {
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
+ }
15
+
16
+ const {
17
+ class: classProp = '',
18
+ className = '',
19
+ glass = false,
20
+ surface = 'default',
21
+ ...rest
22
+ } = Astro.props
23
+
24
+ const resolvedGlass = resolveLumenGlass(glass, surface)
25
+ const { classList, passthrough } = resolveLumenAstroProps(rest, [
26
+ 'ui-navigation-menu',
27
+ resolvedGlass && 'ui-navigation-menu--glass',
28
+ glass === 'subtle' && 'ui-glass-subtle',
29
+ glass === 'strong' && 'ui-glass-strong'
30
+ ], classProp, className)
31
+ ---
32
+
33
+ <nav
34
+ data-surface={resolvedGlass ? 'glass' : 'default'}
35
+ data-ui-navigation-menu
36
+ class:list={classList}
37
+ {...passthrough}
38
+ >
39
+ <slot />
40
+ </nav>