@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,122 @@
1
+ ---
2
+ import { resolveLumenAstroProps } from '@santi020k/lumen-core'
3
+
4
+ import type { HTMLAttributes } from 'astro/types'
5
+
6
+ type DataTableCell =
7
+ | boolean
8
+ | null
9
+ | number
10
+ | string
11
+ | undefined
12
+ | {
13
+ label?: boolean | null | number | string
14
+ sortValue?: boolean | null | number | string
15
+ value?: boolean | null | number | string
16
+ }
17
+
18
+ interface DataTableColumn {
19
+ header?: string
20
+ key: string
21
+ label?: string
22
+ sort?: 'number' | 'string'
23
+ sortable?: boolean
24
+ }
25
+
26
+ type DataTableRow = Record<string, DataTableCell> & {
27
+ id?: number | string
28
+ rowValue?: number | string
29
+ value?: number | string
30
+ }
31
+
32
+ interface Props extends HTMLAttributes<'div'> {
33
+ class?: string
34
+ className?: string
35
+ columns?: DataTableColumn[]
36
+ glass?: boolean | 'subtle' | 'strong'
37
+ name?: string
38
+ rows?: DataTableRow[]
39
+ selectable?: boolean
40
+ }
41
+
42
+ const {
43
+ class: classProp = '',
44
+ className = '',
45
+ columns = [],
46
+ glass = false,
47
+ name,
48
+ rows = [],
49
+ selectable = false,
50
+ ...rest
51
+ } = Astro.props
52
+
53
+ const hasData = columns.length > 0
54
+ const { classList, passthrough } = resolveLumenAstroProps(rest, [
55
+ 'ui-data-table',
56
+ glass && 'ui-data-table--glass',
57
+ glass === 'subtle' && 'ui-glass-subtle',
58
+ glass === 'strong' && 'ui-glass-strong'
59
+ ], classProp, className)
60
+
61
+ const isCellObject = (cell: DataTableCell): cell is Exclude<DataTableCell, boolean | null | number | string | undefined> =>
62
+ typeof cell === 'object' && cell !== null
63
+
64
+ const formatCell = (cell: DataTableCell): string => {
65
+ const value = isCellObject(cell) ? cell.label ?? cell.value : cell
66
+
67
+ return value === undefined || value === null ? '' : String(value)
68
+ }
69
+
70
+ const getSortValue = (cell: DataTableCell): string | undefined => {
71
+ if (!isCellObject(cell) || cell.sortValue === undefined || cell.sortValue === null) return undefined
72
+
73
+ return String(cell.sortValue)
74
+ }
75
+
76
+ const getRowValue = (row: DataTableRow, index: number): string =>
77
+ String(row.rowValue ?? row.value ?? row.id ?? index)
78
+ ---
79
+
80
+ <div
81
+ class:list={classList}
82
+ data-ui-datatable
83
+ data-ui-datatable-name={name}
84
+ data-ui-datatable-selectable={selectable ? 'true' : undefined}
85
+ data-ui-glass-track={glass ? true : undefined}
86
+ {...passthrough}
87
+ >
88
+ {hasData ? (
89
+ <table>
90
+ <thead>
91
+ <tr>
92
+ {columns.map(column => (
93
+ <th
94
+ data-ui-datatable-sort-type={column.sort}
95
+ data-ui-datatable-sortable={column.sortable ? 'true' : undefined}
96
+ scope="col"
97
+ >
98
+ {column.header ?? column.label ?? column.key}
99
+ </th>
100
+ ))}
101
+ </tr>
102
+ </thead>
103
+ <tbody>
104
+ {rows.map((row, rowIndex) => (
105
+ <tr data-ui-datatable-row data-value={getRowValue(row, rowIndex)}>
106
+ {columns.map(column => {
107
+ const cell = row[column.key]
108
+
109
+ return (
110
+ <td data-sort-value={getSortValue(cell)}>
111
+ {formatCell(cell)}
112
+ </td>
113
+ )
114
+ })}
115
+ </tr>
116
+ ))}
117
+ </tbody>
118
+ </table>
119
+ ) : (
120
+ <slot />
121
+ )}
122
+ </div>
@@ -0,0 +1,108 @@
1
+ ---
2
+ import { resolveLumenAstroProps } from '@santi020k/lumen-core'
3
+ import Calendar from './Calendar.astro'
4
+
5
+ import type { HTMLAttributes } from 'astro/types'
6
+
7
+ interface Props extends HTMLAttributes<'input'> {
8
+ class?: string
9
+ className?: string
10
+ glass?: boolean | 'subtle' | 'strong'
11
+ placeholder?: string
12
+ }
13
+
14
+ const {
15
+ class: classProp = '',
16
+ className = '',
17
+ disabled = false,
18
+ glass = false,
19
+ id,
20
+ max,
21
+ min,
22
+ name,
23
+ placeholder,
24
+ required = false,
25
+ type = 'date',
26
+ value,
27
+ ...rest
28
+ } = Astro.props
29
+
30
+ const datePickerId = id ?? `ui-date-picker-${Math.random().toString(36).slice(2)}`
31
+ const triggerId = `${datePickerId}-trigger`
32
+ const popoverId = `${datePickerId}-popover`
33
+
34
+ const { classList, passthrough } = resolveLumenAstroProps(rest, [
35
+ 'ui-date-picker-field',
36
+ glass && 'ui-date-picker-field--glass',
37
+ glass === 'subtle' && 'ui-glass-subtle',
38
+ glass === 'strong' && 'ui-glass-strong'
39
+ ], classProp, className)
40
+
41
+ const selectedValue = value === undefined || value === null ? undefined : String(value)
42
+ const hasSelectedValue = selectedValue !== undefined && selectedValue !== ''
43
+ const placeholderText = placeholder ?? 'Choose a date'
44
+ const selectedDate = hasSelectedValue
45
+ ? new Date(`${selectedValue}T00:00:00.000Z`)
46
+ : undefined
47
+ const displayValue = selectedDate && !Number.isNaN(selectedDate.getTime())
48
+ ? new Intl.DateTimeFormat('en', {
49
+ day: 'numeric',
50
+ month: 'short',
51
+ timeZone: 'UTC',
52
+ year: 'numeric'
53
+ }).format(selectedDate)
54
+ : placeholderText
55
+ ---
56
+
57
+ <div
58
+ class:list={classList}
59
+ data-placeholder={hasSelectedValue ? undefined : 'true'}
60
+ data-ui-date-picker
61
+ data-ui-glass-track={glass ? true : undefined}
62
+ >
63
+ <input
64
+ class="ui-date-picker ui-date-picker__native"
65
+ data-ui-date-picker-native
66
+ disabled={disabled}
67
+ id={datePickerId}
68
+ max={max}
69
+ min={min}
70
+ name={name}
71
+ placeholder={placeholder}
72
+ required={required}
73
+ type={type}
74
+ value={value}
75
+ {...passthrough}
76
+ />
77
+
78
+ <div class="ui-date-picker__control" data-ui-date-picker-control hidden>
79
+ <button
80
+ aria-controls={popoverId}
81
+ aria-expanded="false"
82
+ aria-haspopup="dialog"
83
+ aria-required={required ? 'true' : undefined}
84
+ class="ui-input ui-date-picker ui-date-picker__trigger"
85
+ data-ui-date-picker-trigger
86
+ disabled={disabled}
87
+ id={triggerId}
88
+ type="button"
89
+ >
90
+ <span data-ui-date-picker-value>{displayValue}</span>
91
+ <svg aria-hidden="true" class="ui-date-picker__icon" fill="none" viewBox="0 0 24 24">
92
+ <path d="M7 2v3M17 2v3M3.5 9h17M5 4h14a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Z" />
93
+ </svg>
94
+ </button>
95
+
96
+ <div
97
+ aria-label="Choose date"
98
+ class="ui-date-picker__popover"
99
+ data-state="closed"
100
+ data-ui-date-picker-popover
101
+ hidden
102
+ id={popoverId}
103
+ role="dialog"
104
+ >
105
+ <Calendar max={typeof max === 'string' ? max : undefined} min={typeof min === 'string' ? min : undefined} value={selectedValue} />
106
+ </div>
107
+ </div>
108
+ </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-date-range-picker'
13
+ ], classProp, className)
14
+ ---
15
+
16
+ <div class:list={classList} data-ui-date-range-picker {...passthrough}>
17
+ <slot />
18
+ </div>
@@ -0,0 +1,41 @@
1
+ ---
2
+ import { resolveLumenAstroProps } from '@santi020k/lumen-core'
3
+
4
+ import type { HTMLAttributes } from 'astro/types'
5
+
6
+ type DescriptionItem = { label: string; value: string }
7
+
8
+ interface Props extends HTMLAttributes<'dl'> {
9
+ class?: string
10
+ className?: string
11
+ columns?: number
12
+ items?: DescriptionItem[]
13
+ }
14
+
15
+ const {
16
+ class: classProp = '',
17
+ className = '',
18
+ columns = 1,
19
+ items = [],
20
+ ...rest
21
+ } = Astro.props
22
+
23
+ const { classList, passthrough } = resolveLumenAstroProps(rest, [
24
+ 'ui-descriptions'
25
+ ], classProp, className)
26
+ ---
27
+
28
+ <dl
29
+ class:list={classList}
30
+ data-columns={columns}
31
+ style={`--ui-descriptions-columns:${columns}`}
32
+ {...passthrough}
33
+ >
34
+ {items.map(item => (
35
+ <div class="ui-descriptions__item">
36
+ <dt class="ui-descriptions__term">{item.label}</dt>
37
+ <dd class="ui-descriptions__detail">{item.value}</dd>
38
+ </div>
39
+ ))}
40
+ <slot />
41
+ </dl>
@@ -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<'dialog'> {
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-dialog',
27
+ resolvedGlass && 'ui-dialog--glass',
28
+ glass === 'subtle' && 'ui-glass-subtle',
29
+ glass === 'strong' && 'ui-glass-strong'
30
+ ], classProp, className)
31
+ ---
32
+
33
+ <dialog
34
+ data-surface={resolvedGlass ? 'glass' : 'default'}
35
+ data-ui-dialog
36
+ class:list={classList}
37
+ {...passthrough}
38
+ >
39
+ <slot />
40
+ </dialog>
@@ -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<'div'> {
7
+ class?: string
8
+ className?: string
9
+ dir?: 'ltr' | 'rtl' | 'auto'
10
+ }
11
+
12
+ const {
13
+ class: classProp = '',
14
+ className = '',
15
+ dir = 'ltr',
16
+ ...rest
17
+ } = Astro.props
18
+
19
+ const { classList, passthrough } = resolveLumenAstroProps(rest, [
20
+ 'ui-direction'
21
+ ], classProp, className)
22
+ ---
23
+
24
+ <div
25
+ dir={dir}
26
+ class:list={classList}
27
+ {...passthrough}
28
+ >
29
+ <slot />
30
+ </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<'dialog'> {
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-drawer',
27
+ resolvedGlass && 'ui-drawer--glass',
28
+ glass === 'subtle' && 'ui-glass-subtle',
29
+ glass === 'strong' && 'ui-glass-strong'
30
+ ], classProp, className)
31
+ ---
32
+
33
+ <dialog
34
+ data-surface={resolvedGlass ? 'glass' : 'default'}
35
+ data-ui-drawer
36
+ class:list={classList}
37
+ {...passthrough}
38
+ >
39
+ <slot />
40
+ </dialog>
@@ -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<'div'> {
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-menu',
27
+ resolvedGlass && 'ui-menu--glass',
28
+ glass === 'subtle' && 'ui-glass-subtle',
29
+ glass === 'strong' && 'ui-glass-strong'
30
+ ], classProp, className)
31
+ ---
32
+
33
+ <div
34
+ data-surface={resolvedGlass ? 'glass' : 'default'}
35
+ data-ui-dropdown-menu
36
+ class:list={classList}
37
+ {...passthrough}
38
+ >
39
+ <slot />
40
+ </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<'section'> {
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-empty',
21
+ glass && 'ui-empty--glass',
22
+ glass === 'subtle' && 'ui-glass-subtle',
23
+ glass === 'strong' && 'ui-glass-strong'
24
+ ], classProp, className)
25
+ ---
26
+
27
+ <section
28
+ class:list={classList}
29
+ {...passthrough}
30
+ >
31
+ <slot />
32
+ </section>
@@ -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<'p'> {
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-eyebrow'
19
+ ], classProp, className)
20
+ ---
21
+
22
+ <p
23
+ class:list={classList}
24
+ {...passthrough}
25
+ >
26
+ <slot />
27
+ </p>
@@ -0,0 +1,42 @@
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
+ controlId?: string
10
+ describedBy?: string
11
+ glass?: boolean | 'subtle' | 'strong'
12
+ }
13
+
14
+ const {
15
+ 'aria-describedby': ariaDescribedby,
16
+ class: classProp = '',
17
+ className = '',
18
+ controlId,
19
+ describedBy,
20
+ glass = false,
21
+ ...rest
22
+ } = Astro.props
23
+
24
+ const { classList, passthrough } = resolveLumenAstroProps(rest, [
25
+ 'ui-field',
26
+ glass && 'ui-field--glass',
27
+ glass === 'subtle' && 'ui-glass-subtle',
28
+ glass === 'strong' && 'ui-glass-strong'
29
+ ], classProp, className)
30
+ const fieldDescribedBy = [ariaDescribedby, describedBy].filter(Boolean).join(' ') || undefined
31
+ ---
32
+
33
+ <div
34
+ aria-describedby={ariaDescribedby}
35
+ class:list={classList}
36
+ data-ui-field
37
+ data-ui-field-control={controlId}
38
+ data-ui-field-describedby={fieldDescribedBy}
39
+ {...passthrough}
40
+ >
41
+ <slot />
42
+ </div>
@@ -0,0 +1,44 @@
1
+ ---
2
+ import { resolveLumenAstroProps } from '@santi020k/lumen-core'
3
+
4
+ import type { HTMLAttributes } from 'astro/types'
5
+
6
+ interface Props extends Omit<HTMLAttributes<'input'>, 'type' | 'size'> {
7
+ class?: string
8
+ className?: string
9
+ label?: string
10
+ hint?: string
11
+ }
12
+
13
+ const {
14
+ class: classProp = '',
15
+ className = '',
16
+ label = 'Choose a file or drag it here',
17
+ hint,
18
+ id,
19
+ ...rest
20
+ } = Astro.props
21
+
22
+ const { classList, passthrough } = resolveLumenAstroProps(rest, [
23
+ 'ui-file-upload'
24
+ ], classProp, className)
25
+ ---
26
+
27
+ <label class:list={classList} data-ui-file-upload for={id}>
28
+ <input class="ui-file-upload__input" data-ui-file-upload-input id={id} type="file" {...passthrough} />
29
+ <svg
30
+ aria-hidden="true"
31
+ class="ui-file-upload__icon"
32
+ fill="none"
33
+ focusable="false"
34
+ viewBox="0 0 24 24"
35
+ >
36
+ <path d="M12 16V4m0 0L8 8m4-4 4 4"></path>
37
+ <path d="M5 14v4a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-4"></path>
38
+ </svg>
39
+ <span class="ui-file-upload__prompt">
40
+ <slot>{label}</slot>
41
+ </span>
42
+ {hint && <span class="ui-file-upload__hint">{hint}</span>}
43
+ <span aria-live="polite" class="ui-file-upload__files" data-ui-file-upload-files></span>
44
+ </label>
@@ -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-floating-badge'
19
+ ], classProp, className)
20
+ ---
21
+
22
+ <span
23
+ class:list={classList}
24
+ {...passthrough}
25
+ >
26
+ <slot />
27
+ </span>
@@ -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<'time'> {
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-formatted-date'
19
+ ], classProp, className)
20
+ ---
21
+
22
+ <time
23
+ class:list={classList}
24
+ {...passthrough}
25
+ >
26
+ <slot />
27
+ </time>
@@ -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 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-gradient-divider'
19
+ ], classProp, className)
20
+ ---
21
+
22
+ <div aria-hidden="true" class:list={classList} {...passthrough}>
23
+ <div class="ui-gradient-divider__line"></div>
24
+ </div>