@santi020k/lumen-astro 0.3.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +100 -2
- package/components/Accordion.astro +4 -4
- package/components/Affix.astro +2 -2
- package/components/Agenda.astro +3 -2
- package/components/Alert.astro +9 -9
- package/components/AlertDialog.astro +7 -13
- package/components/Anchor.astro +29 -3
- package/components/AnimatedLogo.astro +2 -1
- package/components/AnimatedNumber.astro +5 -2
- package/components/AnimatedPortrait.astro +46 -36
- package/components/AspectRatio.astro +10 -8
- package/components/Attachment.astro +24 -24
- package/components/Autocomplete.astro +3 -2
- package/components/Avatar.astro +4 -3
- package/components/BackToTop.astro +2 -2
- package/components/Badge.astro +9 -9
- package/components/BarChart.astro +211 -0
- package/components/Breadcrumb.astro +3 -3
- package/components/Bubble.astro +7 -7
- package/components/Button.astro +18 -16
- package/components/ButtonGroup.astro +3 -3
- package/components/ButtonLink.astro +9 -3
- package/components/Calendar.astro +43 -31
- package/components/Callout.astro +2 -2
- package/components/Card.astro +12 -10
- package/components/CardContent.astro +26 -0
- package/components/CardDescription.astro +26 -0
- package/components/CardFooter.astro +26 -0
- package/components/CardHeader.astro +26 -0
- package/components/CardTitle.astro +26 -0
- package/components/Carousel.astro +6 -6
- package/components/Cascader.astro +10 -4
- package/components/Chart.astro +32 -6
- package/components/Checkbox.astro +3 -2
- package/components/CheckboxGroup.astro +39 -0
- package/components/Code.astro +55 -52
- package/components/CodeTabs.astro +6 -6
- package/components/Collapsible.astro +3 -3
- package/components/ColorPicker.astro +3 -2
- package/components/Combobox.astro +4 -5
- package/components/Command.astro +6 -6
- package/components/Container.astro +29 -0
- package/components/ContextMenu.astro +7 -13
- package/components/CopyButton.astro +55 -0
- package/components/CoverImage.astro +19 -9
- package/components/DataTable.astro +50 -49
- package/components/DatePicker.astro +20 -17
- package/components/DateRangePicker.astro +3 -2
- package/components/Descriptions.astro +3 -3
- package/components/Dialog.astro +8 -14
- package/components/Direction.astro +3 -3
- package/components/Drawer.astro +7 -13
- package/components/DropdownMenu.astro +7 -13
- package/components/Empty.astro +6 -6
- package/components/ErrorSummary.astro +54 -0
- package/components/Eyebrow.astro +2 -2
- package/components/Field.astro +7 -6
- package/components/FieldError.astro +29 -0
- package/components/FileUpload.astro +2 -2
- package/components/FloatingBadge.astro +2 -2
- package/components/Form.astro +33 -0
- package/components/FormattedDate.astro +2 -2
- package/components/GradientDivider.astro +2 -2
- package/components/Grid.astro +46 -0
- package/components/HoverCard.astro +7 -13
- package/components/Icon.astro +8 -6
- package/components/Image.astro +2 -1
- package/components/Input.astro +6 -5
- package/components/InputGroup.astro +3 -3
- package/components/InputOTP.astro +5 -3
- package/components/Item.astro +11 -8
- package/components/Kbd.astro +3 -3
- package/components/Label.astro +3 -2
- package/components/LanguageToggle.astro +2 -2
- package/components/LineChart.astro +244 -0
- package/components/Link.astro +6 -5
- package/components/ListBox.astro +154 -0
- package/components/Marker.astro +6 -6
- package/components/Mentions.astro +30 -10
- package/components/Menubar.astro +7 -13
- package/components/Message.astro +5 -5
- package/components/MessageScroller.astro +6 -6
- package/components/Meter.astro +1 -0
- package/components/NativeSelect.astro +4 -5
- package/components/NavigationMenu.astro +9 -14
- package/components/Note.astro +1 -1
- package/components/NumberField.astro +3 -2
- package/components/Pagination.astro +3 -3
- package/components/Particles.astro +58 -2
- package/components/PasswordField.astro +73 -0
- package/components/PhoneInput.astro +5 -7
- package/components/PieChart.astro +141 -0
- package/components/Pill.astro +15 -9
- package/components/Popconfirm.astro +8 -3
- package/components/Popover.astro +7 -13
- package/components/Progress.astro +12 -4
- package/components/Prose.astro +2 -2
- package/components/QRCode.astro +13 -5
- package/components/RadioGroup.astro +3 -3
- package/components/Rating.astro +3 -1
- package/components/Resizable.astro +8 -7
- package/components/RevealGroup.astro +4 -2
- package/components/RichTextEditor.astro +3 -2
- package/components/Schedule.astro +3 -2
- package/components/ScrollArea.astro +6 -6
- package/components/ScrollProgress.astro +38 -0
- package/components/ScrollReveal.astro +4 -2
- package/components/SearchField.astro +3 -2
- package/components/Segmented.astro +4 -6
- package/components/Select.astro +23 -14
- package/components/Separator.astro +5 -5
- package/components/Sheet.astro +7 -13
- package/components/Sidebar.astro +9 -14
- package/components/Skeleton.astro +4 -3
- package/components/SkipLink.astro +2 -2
- package/components/Slider.astro +3 -2
- package/components/Sonner.astro +3 -3
- package/components/Sparkline.astro +72 -0
- package/components/SpeedDial.astro +3 -3
- package/components/Spinner.astro +4 -3
- package/components/Stack.astro +46 -0
- package/components/Stat.astro +14 -8
- package/components/StatDescription.astro +16 -0
- package/components/StatIcon.astro +15 -0
- package/components/StatLabel.astro +16 -0
- package/components/StatTrend.astro +28 -0
- package/components/StatValue.astro +16 -0
- package/components/Stepper.astro +11 -8
- package/components/Switch.astro +3 -2
- package/components/Table.astro +7 -6
- package/components/Tabs.astro +6 -6
- package/components/TagGroup.astro +3 -2
- package/components/Textarea.astro +3 -2
- package/components/ThemeBuilder.astro +3 -2
- package/components/ThemeToggle.astro +5 -3
- package/components/TimeField.astro +3 -2
- package/components/Timeline.astro +2 -1
- package/components/TimelineItem.astro +2 -1
- package/components/Toast.astro +10 -16
- package/components/Toggle.astro +3 -2
- package/components/ToggleGroup.astro +3 -3
- package/components/Toolbar.astro +2 -2
- package/components/Tooltip.astro +3 -3
- package/components/Tour.astro +3 -3
- package/components/Transfer.astro +16 -5
- package/components/Tree.astro +3 -2
- package/components/TreeGrid.astro +3 -2
- package/components/TreeSelect.astro +10 -4
- package/components/Typography.astro +3 -3
- package/components/VirtualList.astro +3 -2
- package/components/VisuallyHidden.astro +27 -0
- package/components/Watermark.astro +11 -7
- package/forms.ts +46 -0
- package/index.ts +31 -0
- package/package.json +12 -8
- package/runtime/UIPrimitives.astro +3764 -3142
- package/runtime/controllers/motion.ts +13 -16
- package/index.d.ts +0 -126
|
@@ -1,15 +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
|
type DataTableCell =
|
|
7
|
-
| boolean
|
|
8
|
-
|
|
|
9
|
-
|
|
|
10
|
-
|
|
|
11
|
-
|
|
|
12
|
-
|
|
7
|
+
| boolean |
|
|
8
|
+
null |
|
|
9
|
+
number |
|
|
10
|
+
string |
|
|
11
|
+
undefined |
|
|
12
|
+
{
|
|
13
13
|
label?: boolean | null | number | string
|
|
14
14
|
sortValue?: boolean | null | number | string
|
|
15
15
|
value?: boolean | null | number | string
|
|
@@ -51,15 +51,15 @@ const {
|
|
|
51
51
|
} = Astro.props
|
|
52
52
|
|
|
53
53
|
const hasData = columns.length > 0
|
|
54
|
+
|
|
54
55
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
'ui-data-table',
|
|
57
|
+
glass && 'ui-data-table--glass',
|
|
58
|
+
glass === 'subtle' && 'ui-glass-subtle',
|
|
59
|
+
glass === 'strong' && 'ui-glass-strong'
|
|
59
60
|
], classProp, className)
|
|
60
61
|
|
|
61
|
-
const isCellObject = (cell: DataTableCell): cell is Exclude<DataTableCell, boolean | null | number | string | undefined> =>
|
|
62
|
-
typeof cell === 'object' && cell !== null
|
|
62
|
+
const isCellObject = (cell: DataTableCell): cell is Exclude<DataTableCell, boolean | null | number | string | undefined> => typeof cell === 'object' && cell !== null
|
|
63
63
|
|
|
64
64
|
const formatCell = (cell: DataTableCell): string => {
|
|
65
65
|
const value = isCellObject(cell) ? cell.label ?? cell.value : cell
|
|
@@ -73,8 +73,7 @@ const getSortValue = (cell: DataTableCell): string | undefined => {
|
|
|
73
73
|
return String(cell.sortValue)
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
const getRowValue = (row: DataTableRow, index: number): string =>
|
|
77
|
-
String(row.rowValue ?? row.value ?? row.id ?? index)
|
|
76
|
+
const getRowValue = (row: DataTableRow, index: number): string => String(row.rowValue ?? row.value ?? row.id ?? index)
|
|
78
77
|
---
|
|
79
78
|
|
|
80
79
|
<div
|
|
@@ -85,38 +84,40 @@ const getRowValue = (row: DataTableRow, index: number): string =>
|
|
|
85
84
|
data-ui-glass-track={glass ? true : undefined}
|
|
86
85
|
{...passthrough}
|
|
87
86
|
>
|
|
88
|
-
{hasData ?
|
|
89
|
-
|
|
90
|
-
<
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
-
})}
|
|
87
|
+
{hasData ?
|
|
88
|
+
(
|
|
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
|
+
))}
|
|
115
101
|
</tr>
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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
|
+
(
|
|
121
|
+
<slot />
|
|
122
|
+
)}
|
|
122
123
|
</div>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types'
|
|
3
|
+
|
|
2
4
|
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
3
|
-
import Calendar from './Calendar.astro'
|
|
4
5
|
|
|
5
|
-
import
|
|
6
|
+
import Calendar from './Calendar.astro'
|
|
6
7
|
|
|
7
8
|
interface Props extends HTMLAttributes<'input'> {
|
|
8
9
|
class?: string | null
|
|
@@ -32,26 +33,28 @@ const triggerId = `${datePickerId}-trigger`
|
|
|
32
33
|
const popoverId = `${datePickerId}-popover`
|
|
33
34
|
|
|
34
35
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
'ui-date-picker-field',
|
|
37
|
+
glass && 'ui-date-picker-field--glass',
|
|
38
|
+
glass === 'subtle' && 'ui-glass-subtle',
|
|
39
|
+
glass === 'strong' && 'ui-glass-strong'
|
|
39
40
|
], classProp, className)
|
|
40
41
|
|
|
41
42
|
const selectedValue = value === undefined || value === null ? undefined : String(value)
|
|
42
43
|
const hasSelectedValue = selectedValue !== undefined && selectedValue !== ''
|
|
43
44
|
const placeholderText = placeholder ?? 'Choose a date'
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
45
|
+
|
|
46
|
+
const selectedDate = hasSelectedValue ?
|
|
47
|
+
new Date(`${selectedValue}T00:00:00.000Z`) :
|
|
48
|
+
undefined
|
|
49
|
+
|
|
50
|
+
const displayValue = selectedDate && !Number.isNaN(selectedDate.getTime()) ?
|
|
51
|
+
new Intl.DateTimeFormat('en', {
|
|
52
|
+
day: 'numeric',
|
|
53
|
+
month: 'short',
|
|
54
|
+
timeZone: 'UTC',
|
|
55
|
+
year: 'numeric'
|
|
56
|
+
}).format(selectedDate) :
|
|
57
|
+
placeholderText
|
|
55
58
|
---
|
|
56
59
|
|
|
57
60
|
<div
|
|
@@ -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<'div'> {
|
|
7
7
|
class?: string | null
|
|
8
8
|
className?: string
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
const { class: classProp = '', className = '', ...rest } = Astro.props
|
|
12
|
+
|
|
12
13
|
const { classList, passthrough } = resolveLumenAstroProps(rest, ['ui-date-range-picker'
|
|
13
14
|
], classProp, className)
|
|
14
15
|
---
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
3
|
-
|
|
4
2
|
import type { HTMLAttributes } from 'astro/types'
|
|
5
3
|
|
|
6
|
-
|
|
4
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
5
|
+
|
|
6
|
+
interface DescriptionItem { label: string, value: string }
|
|
7
7
|
|
|
8
8
|
interface Props extends HTMLAttributes<'dl'> {
|
|
9
9
|
class?: string | null
|
package/components/Dialog.astro
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
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
10
|
layout?: 'centered' | 'fullscreen'
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated Use `glass` instead. `surface="glass"` maps to `glass={true}`.
|
|
13
|
-
*/
|
|
14
|
-
surface?: 'default' | 'glass'
|
|
15
11
|
}
|
|
16
12
|
|
|
17
13
|
const {
|
|
@@ -19,22 +15,20 @@ const {
|
|
|
19
15
|
className = '',
|
|
20
16
|
glass = false,
|
|
21
17
|
layout = 'centered',
|
|
22
|
-
surface = 'default',
|
|
23
18
|
...rest
|
|
24
19
|
} = Astro.props
|
|
25
20
|
|
|
26
|
-
const resolvedGlass = resolveLumenGlass(glass, surface)
|
|
27
21
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
'ui-dialog',
|
|
23
|
+
layout === 'fullscreen' && 'ui-dialog--fullscreen',
|
|
24
|
+
glass && 'ui-dialog--glass',
|
|
25
|
+
glass === 'subtle' && 'ui-glass-subtle',
|
|
26
|
+
glass === 'strong' && 'ui-glass-strong'
|
|
33
27
|
], classProp, className)
|
|
34
28
|
---
|
|
35
29
|
|
|
36
30
|
<dialog
|
|
37
|
-
data-surface={
|
|
31
|
+
data-surface={glass ? 'glass' : 'default'}
|
|
38
32
|
data-layout={layout}
|
|
39
33
|
data-ui-dialog
|
|
40
34
|
class:list={classList}
|
|
@@ -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,7 +17,7 @@ const {
|
|
|
17
17
|
} = Astro.props
|
|
18
18
|
|
|
19
19
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
20
|
-
|
|
20
|
+
'ui-direction'
|
|
21
21
|
], classProp, className)
|
|
22
22
|
---
|
|
23
23
|
|
package/components/Drawer.astro
CHANGED
|
@@ -1,37 +1,31 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { resolveLumenAstroProps, resolveLumenGlass } from '@santi020k/lumen-core'
|
|
3
|
-
|
|
4
2
|
import type { HTMLAttributes } from 'astro/types'
|
|
5
3
|
|
|
4
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
5
|
+
|
|
6
6
|
interface Props extends HTMLAttributes<'dialog'> {
|
|
7
7
|
class?: string | null
|
|
8
8
|
className?: string
|
|
9
9
|
glass?: boolean | 'subtle' | 'strong'
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated Use `glass` instead. `surface="glass"` maps to `glass={true}`.
|
|
12
|
-
*/
|
|
13
|
-
surface?: 'default' | 'glass'
|
|
14
10
|
}
|
|
15
11
|
|
|
16
12
|
const {
|
|
17
13
|
class: classProp = '',
|
|
18
14
|
className = '',
|
|
19
15
|
glass = false,
|
|
20
|
-
surface = 'default',
|
|
21
16
|
...rest
|
|
22
17
|
} = Astro.props
|
|
23
18
|
|
|
24
|
-
const resolvedGlass = resolveLumenGlass(glass, surface)
|
|
25
19
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
20
|
+
'ui-drawer',
|
|
21
|
+
glass && 'ui-drawer--glass',
|
|
22
|
+
glass === 'subtle' && 'ui-glass-subtle',
|
|
23
|
+
glass === 'strong' && 'ui-glass-strong'
|
|
30
24
|
], classProp, className)
|
|
31
25
|
---
|
|
32
26
|
|
|
33
27
|
<dialog
|
|
34
|
-
data-surface={
|
|
28
|
+
data-surface={glass ? 'glass' : 'default'}
|
|
35
29
|
data-ui-drawer
|
|
36
30
|
class:list={classList}
|
|
37
31
|
{...passthrough}
|
|
@@ -1,37 +1,31 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { resolveLumenAstroProps, resolveLumenGlass } from '@santi020k/lumen-core'
|
|
3
|
-
|
|
4
2
|
import type { HTMLAttributes } from 'astro/types'
|
|
5
3
|
|
|
4
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
5
|
+
|
|
6
6
|
interface Props extends HTMLAttributes<'div'> {
|
|
7
7
|
class?: string | null
|
|
8
8
|
className?: string
|
|
9
9
|
glass?: boolean | 'subtle' | 'strong'
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated Use `glass` instead. `surface="glass"` maps to `glass={true}`.
|
|
12
|
-
*/
|
|
13
|
-
surface?: 'default' | 'glass'
|
|
14
10
|
}
|
|
15
11
|
|
|
16
12
|
const {
|
|
17
13
|
class: classProp = '',
|
|
18
14
|
className = '',
|
|
19
15
|
glass = false,
|
|
20
|
-
surface = 'default',
|
|
21
16
|
...rest
|
|
22
17
|
} = Astro.props
|
|
23
18
|
|
|
24
|
-
const resolvedGlass = resolveLumenGlass(glass, surface)
|
|
25
19
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
20
|
+
'ui-menu',
|
|
21
|
+
glass && 'ui-menu--glass',
|
|
22
|
+
glass === 'subtle' && 'ui-glass-subtle',
|
|
23
|
+
glass === 'strong' && 'ui-glass-strong'
|
|
30
24
|
], classProp, className)
|
|
31
25
|
---
|
|
32
26
|
|
|
33
27
|
<div
|
|
34
|
-
data-surface={
|
|
28
|
+
data-surface={glass ? 'glass' : 'default'}
|
|
35
29
|
data-ui-dropdown-menu
|
|
36
30
|
class:list={classList}
|
|
37
31
|
{...passthrough}
|
package/components/Empty.astro
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
3
|
-
|
|
4
2
|
import type { HTMLAttributes } from 'astro/types'
|
|
5
3
|
|
|
4
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
5
|
+
|
|
6
6
|
interface Props extends HTMLAttributes<'section'> {
|
|
7
7
|
class?: string | null
|
|
8
8
|
className?: string
|
|
@@ -17,10 +17,10 @@ const {
|
|
|
17
17
|
} = Astro.props
|
|
18
18
|
|
|
19
19
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
'ui-empty',
|
|
21
|
+
glass && 'ui-empty--glass',
|
|
22
|
+
glass === 'subtle' && 'ui-glass-subtle',
|
|
23
|
+
glass === 'strong' && 'ui-glass-strong'
|
|
24
24
|
], classProp, className)
|
|
25
25
|
---
|
|
26
26
|
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types'
|
|
3
|
+
|
|
4
|
+
import type { LumenFormErrorInput } from '@santi020k/lumen-core'
|
|
5
|
+
import { normalizeLumenFormErrors, resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
6
|
+
|
|
7
|
+
interface Props extends HTMLAttributes<'section'> {
|
|
8
|
+
class?: string | null
|
|
9
|
+
className?: string
|
|
10
|
+
errors?: LumenFormErrorInput
|
|
11
|
+
heading?: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const {
|
|
15
|
+
class: classProp = '',
|
|
16
|
+
className = '',
|
|
17
|
+
errors,
|
|
18
|
+
heading = 'There is a problem',
|
|
19
|
+
id,
|
|
20
|
+
...rest
|
|
21
|
+
} = Astro.props
|
|
22
|
+
|
|
23
|
+
const normalizedErrors = normalizeLumenFormErrors(errors)
|
|
24
|
+
|
|
25
|
+
const allErrors = [
|
|
26
|
+
...normalizedErrors.form.map(message => ({ message })),
|
|
27
|
+
...normalizedErrors.fields
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
const summaryId = id ?? 'ui-error-summary'
|
|
31
|
+
const headingId = `${summaryId}-heading`
|
|
32
|
+
const { classList, passthrough } = resolveLumenAstroProps(rest, ['ui-error-summary'], classProp, className)
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
<section
|
|
36
|
+
aria-labelledby={headingId}
|
|
37
|
+
class:list={classList}
|
|
38
|
+
data-ui-error-summary
|
|
39
|
+
hidden={allErrors.length === 0}
|
|
40
|
+
id={summaryId}
|
|
41
|
+
tabindex="-1"
|
|
42
|
+
{...passthrough}
|
|
43
|
+
>
|
|
44
|
+
<h2 id={headingId}>{heading}</h2>
|
|
45
|
+
<ul>
|
|
46
|
+
{allErrors.map(error => (
|
|
47
|
+
<li>
|
|
48
|
+
{error.controlId ?
|
|
49
|
+
<a href={`#${error.controlId}`}>{error.message}</a> :
|
|
50
|
+
error.message}
|
|
51
|
+
</li>
|
|
52
|
+
))}
|
|
53
|
+
</ul>
|
|
54
|
+
</section>
|
package/components/Eyebrow.astro
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
3
|
-
|
|
4
2
|
import type { HTMLAttributes } from 'astro/types'
|
|
5
3
|
|
|
4
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
5
|
+
|
|
6
6
|
interface Props extends HTMLAttributes<'p'> {
|
|
7
7
|
class?: string | null
|
|
8
8
|
className?: string
|
package/components/Field.astro
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
3
|
-
|
|
4
2
|
import type { HTMLAttributes } from 'astro/types'
|
|
5
3
|
|
|
4
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
5
|
+
|
|
6
6
|
interface Props extends HTMLAttributes<'div'> {
|
|
7
7
|
class?: string | null
|
|
8
8
|
className?: string
|
|
@@ -22,11 +22,12 @@ const {
|
|
|
22
22
|
} = Astro.props
|
|
23
23
|
|
|
24
24
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
'ui-field',
|
|
26
|
+
glass && 'ui-field--glass',
|
|
27
|
+
glass === 'subtle' && 'ui-glass-subtle',
|
|
28
|
+
glass === 'strong' && 'ui-glass-strong'
|
|
29
29
|
], classProp, className)
|
|
30
|
+
|
|
30
31
|
const fieldDescribedBy = [ariaDescribedby, describedBy].filter(Boolean).join(' ') || undefined
|
|
31
32
|
---
|
|
32
33
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types'
|
|
3
|
+
|
|
4
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
5
|
+
|
|
6
|
+
interface Props extends HTMLAttributes<'p'> {
|
|
7
|
+
class?: string | null
|
|
8
|
+
className?: string
|
|
9
|
+
message?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const {
|
|
13
|
+
class: classProp = '',
|
|
14
|
+
className = '',
|
|
15
|
+
message,
|
|
16
|
+
...rest
|
|
17
|
+
} = Astro.props
|
|
18
|
+
|
|
19
|
+
const { classList, passthrough } = resolveLumenAstroProps(rest, ['ui-field-error'], classProp, className)
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
<p
|
|
23
|
+
class:list={classList}
|
|
24
|
+
data-ui-field-error
|
|
25
|
+
hidden={!message}
|
|
26
|
+
{...passthrough}
|
|
27
|
+
>
|
|
28
|
+
<slot>{message}</slot>
|
|
29
|
+
</p>
|
|
@@ -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 Omit<HTMLAttributes<'input'>, 'type' | 'size'> {
|
|
7
7
|
class?: string | null
|
|
8
8
|
className?: string
|
|
@@ -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<'span'> {
|
|
7
7
|
class?: string | null
|
|
8
8
|
className?: string
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types'
|
|
3
|
+
|
|
4
|
+
import type { LumenFormStatus } from '@santi020k/lumen-core'
|
|
5
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
6
|
+
|
|
7
|
+
interface Props extends HTMLAttributes<'form'> {
|
|
8
|
+
class?: string | null
|
|
9
|
+
className?: string
|
|
10
|
+
enhance?: boolean
|
|
11
|
+
status?: LumenFormStatus
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const {
|
|
15
|
+
class: classProp = '',
|
|
16
|
+
className = '',
|
|
17
|
+
enhance = true,
|
|
18
|
+
status = 'idle',
|
|
19
|
+
...rest
|
|
20
|
+
} = Astro.props
|
|
21
|
+
|
|
22
|
+
const { classList, passthrough } = resolveLumenAstroProps(rest, ['ui-form'], classProp, className)
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
<form
|
|
26
|
+
aria-busy={status === 'submitting' ? 'true' : undefined}
|
|
27
|
+
class:list={classList}
|
|
28
|
+
data-status={status}
|
|
29
|
+
data-ui-form={enhance ? true : undefined}
|
|
30
|
+
{...passthrough}
|
|
31
|
+
>
|
|
32
|
+
<slot />
|
|
33
|
+
</form>
|
|
@@ -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<'time'> {
|
|
7
7
|
class?: string | null
|
|
8
8
|
className?: string
|
|
@@ -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
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types'
|
|
3
|
+
|
|
4
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
5
|
+
|
|
6
|
+
interface Props extends HTMLAttributes<'div'> {
|
|
7
|
+
as?: 'div' | 'ol' | 'section' | 'ul'
|
|
8
|
+
class?: string | null
|
|
9
|
+
className?: string
|
|
10
|
+
columns?: 1 | 2 | 3 | 4 | 6 | 12 | 'auto'
|
|
11
|
+
gap?: 'lg' | 'md' | 'none' | 'sm' | 'xl'
|
|
12
|
+
minItemWidth?: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const {
|
|
16
|
+
as: Tag = 'div',
|
|
17
|
+
class: classProp = '',
|
|
18
|
+
className = '',
|
|
19
|
+
columns = 'auto',
|
|
20
|
+
gap = 'md',
|
|
21
|
+
minItemWidth,
|
|
22
|
+
style,
|
|
23
|
+
...rest
|
|
24
|
+
} = Astro.props
|
|
25
|
+
|
|
26
|
+
const gridStyle = [
|
|
27
|
+
typeof style === 'string' ? style : '',
|
|
28
|
+
minItemWidth ? `--ui-grid-min:${minItemWidth}` : ''
|
|
29
|
+
].filter(Boolean).join(';')
|
|
30
|
+
|
|
31
|
+
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
32
|
+
'ui-grid',
|
|
33
|
+
`ui-grid--columns-${columns}`,
|
|
34
|
+
`ui-grid--gap-${gap}`
|
|
35
|
+
], classProp, className)
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
<Tag
|
|
39
|
+
class:list={classList}
|
|
40
|
+
data-columns={columns}
|
|
41
|
+
data-ui-grid
|
|
42
|
+
style={gridStyle || undefined}
|
|
43
|
+
{...passthrough}
|
|
44
|
+
>
|
|
45
|
+
<slot />
|
|
46
|
+
</Tag>
|