@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.
- package/LICENSE +21 -0
- package/README.md +142 -0
- package/components/Accordion.astro +27 -0
- package/components/Affix.astro +41 -0
- package/components/Agenda.astro +19 -0
- package/components/Alert.astro +38 -0
- package/components/AlertDialog.astro +41 -0
- package/components/Anchor.astro +43 -0
- package/components/AnimatedLogo.astro +30 -0
- package/components/AnimatedNumber.astro +56 -0
- package/components/AnimatedPortrait.astro +124 -0
- package/components/AspectRatio.astro +39 -0
- package/components/Attachment.astro +46 -0
- package/components/Autocomplete.astro +24 -0
- package/components/Avatar.astro +36 -0
- package/components/BackToTop.astro +30 -0
- package/components/Badge.astro +36 -0
- package/components/Breadcrumb.astro +28 -0
- package/components/Bubble.astro +36 -0
- package/components/Button.astro +52 -0
- package/components/ButtonGroup.astro +27 -0
- package/components/ButtonLink.astro +58 -0
- package/components/Calendar.astro +197 -0
- package/components/Callout.astro +27 -0
- package/components/Card.astro +40 -0
- package/components/Carousel.astro +33 -0
- package/components/Cascader.astro +109 -0
- package/components/Chart.astro +32 -0
- package/components/Checkbox.astro +22 -0
- package/components/Code.astro +96 -0
- package/components/Collapsible.astro +28 -0
- package/components/ColorPicker.astro +16 -0
- package/components/Combobox.astro +67 -0
- package/components/Command.astro +33 -0
- package/components/ContextMenu.astro +44 -0
- package/components/CoverImage.astro +180 -0
- package/components/DataTable.astro +122 -0
- package/components/DatePicker.astro +108 -0
- package/components/DateRangePicker.astro +18 -0
- package/components/Descriptions.astro +41 -0
- package/components/Dialog.astro +40 -0
- package/components/Direction.astro +30 -0
- package/components/Drawer.astro +40 -0
- package/components/DropdownMenu.astro +40 -0
- package/components/Empty.astro +32 -0
- package/components/Eyebrow.astro +27 -0
- package/components/Field.astro +42 -0
- package/components/FileUpload.astro +44 -0
- package/components/FloatingBadge.astro +27 -0
- package/components/FormattedDate.astro +27 -0
- package/components/GradientDivider.astro +24 -0
- package/components/HoverCard.astro +40 -0
- package/components/Icon.astro +50 -0
- package/components/Image.astro +33 -0
- package/components/Input.astro +24 -0
- package/components/InputGroup.astro +27 -0
- package/components/InputOTP.astro +60 -0
- package/components/Item.astro +32 -0
- package/components/Kbd.astro +27 -0
- package/components/Label.astro +18 -0
- package/components/LanguageToggle.astro +30 -0
- package/components/Link.astro +27 -0
- package/components/Marker.astro +33 -0
- package/components/Mentions.astro +47 -0
- package/components/Menubar.astro +40 -0
- package/components/Message.astro +32 -0
- package/components/MessageScroller.astro +32 -0
- package/components/Meter.astro +31 -0
- package/components/NativeSelect.astro +37 -0
- package/components/NavigationMenu.astro +40 -0
- package/components/Note.astro +23 -0
- package/components/NumberField.astro +16 -0
- package/components/Pagination.astro +28 -0
- package/components/Particles.astro +31 -0
- package/components/PhoneInput.astro +86 -0
- package/components/Pill.astro +30 -0
- package/components/Popconfirm.astro +40 -0
- package/components/Popover.astro +40 -0
- package/components/Progress.astro +30 -0
- package/components/Prose.astro +27 -0
- package/components/QRCode.astro +44 -0
- package/components/RadioGroup.astro +28 -0
- package/components/Rating.astro +42 -0
- package/components/Resizable.astro +55 -0
- package/components/RevealGroup.astro +54 -0
- package/components/RichTextEditor.astro +19 -0
- package/components/Schedule.astro +19 -0
- package/components/ScrollArea.astro +32 -0
- package/components/ScrollReveal.astro +50 -0
- package/components/SearchField.astro +16 -0
- package/components/Segmented.astro +56 -0
- package/components/Select.astro +120 -0
- package/components/Separator.astro +31 -0
- package/components/Sheet.astro +40 -0
- package/components/Sidebar.astro +39 -0
- package/components/Skeleton.astro +36 -0
- package/components/SkipLink.astro +27 -0
- package/components/Slider.astro +20 -0
- package/components/Sonner.astro +38 -0
- package/components/SpeedDial.astro +77 -0
- package/components/Spinner.astro +36 -0
- package/components/Stat.astro +34 -0
- package/components/Stepper.astro +57 -0
- package/components/Switch.astro +23 -0
- package/components/Table.astro +32 -0
- package/components/Tabs.astro +33 -0
- package/components/TagGroup.astro +18 -0
- package/components/Textarea.astro +17 -0
- package/components/ThemeBuilder.astro +19 -0
- package/components/ThemeToggle.astro +41 -0
- package/components/TimeField.astro +16 -0
- package/components/Timeline.astro +12 -0
- package/components/TimelineItem.astro +19 -0
- package/components/Toast.astro +50 -0
- package/components/Toggle.astro +25 -0
- package/components/ToggleGroup.astro +28 -0
- package/components/Toolbar.astro +36 -0
- package/components/Tooltip.astro +27 -0
- package/components/Tour.astro +52 -0
- package/components/Transfer.astro +70 -0
- package/components/Tree.astro +19 -0
- package/components/TreeGrid.astro +19 -0
- package/components/TreeSelect.astro +69 -0
- package/components/Typography.astro +27 -0
- package/components/VirtualList.astro +19 -0
- package/components/Watermark.astro +60 -0
- package/index.d.ts +125 -0
- package/index.ts +125 -0
- package/package.json +74 -0
- package/runtime/UIPrimitives.astro +4649 -0
- package/styles/lumen.css +5 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
3
|
+
|
|
4
|
+
import type { HTMLAttributes } from 'astro/types'
|
|
5
|
+
|
|
6
|
+
interface Props extends HTMLAttributes<'div'> {
|
|
7
|
+
animation?: 'fade' | 'slide-up' | 'scale'
|
|
8
|
+
class?: string
|
|
9
|
+
className?: string
|
|
10
|
+
delay?: number
|
|
11
|
+
duration?: 'fast' | 'standard' | 'slow'
|
|
12
|
+
once?: boolean
|
|
13
|
+
threshold?: number
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const {
|
|
17
|
+
animation = 'fade',
|
|
18
|
+
class: classProp = '',
|
|
19
|
+
className = '',
|
|
20
|
+
delay = 0,
|
|
21
|
+
duration = 'slow',
|
|
22
|
+
once = true,
|
|
23
|
+
style,
|
|
24
|
+
threshold = 0.15,
|
|
25
|
+
...rest
|
|
26
|
+
} = Astro.props
|
|
27
|
+
|
|
28
|
+
const safeDelay = Math.max(0, delay)
|
|
29
|
+
const safeThreshold = Math.min(1, Math.max(0, threshold))
|
|
30
|
+
const motionStyle = [
|
|
31
|
+
typeof style === 'string' ? style : '',
|
|
32
|
+
`--ui-reveal-delay:${safeDelay}ms`
|
|
33
|
+
].filter(Boolean).join(';')
|
|
34
|
+
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
35
|
+
'ui-scroll-reveal',
|
|
36
|
+
`ui-scroll-reveal-${animation}`,
|
|
37
|
+
`ui-motion-duration-${duration}`
|
|
38
|
+
], classProp, className)
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
<div
|
|
42
|
+
class:list={classList}
|
|
43
|
+
data-ui-reveal-once={String(once)}
|
|
44
|
+
data-ui-reveal-threshold={safeThreshold}
|
|
45
|
+
data-ui-scroll-reveal
|
|
46
|
+
style={motionStyle}
|
|
47
|
+
{...passthrough}
|
|
48
|
+
>
|
|
49
|
+
<slot />
|
|
50
|
+
</div>
|
|
@@ -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 = 'search', ...rest } = Astro.props
|
|
12
|
+
const { classList, passthrough } = resolveLumenAstroProps(rest, ['ui-input', 'ui-search-field'
|
|
13
|
+
], classProp, className)
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
<input class:list={classList} type={type} {...passthrough} />
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
3
|
+
|
|
4
|
+
import type { HTMLAttributes } from 'astro/types'
|
|
5
|
+
|
|
6
|
+
type SegmentedOption = string | { disabled?: boolean; label: string; value: string }
|
|
7
|
+
|
|
8
|
+
interface Props extends HTMLAttributes<'div'> {
|
|
9
|
+
class?: string
|
|
10
|
+
className?: string
|
|
11
|
+
defaultValue?: string
|
|
12
|
+
name?: string
|
|
13
|
+
options?: SegmentedOption[]
|
|
14
|
+
size?: 'default' | 'sm' | 'lg'
|
|
15
|
+
value?: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const {
|
|
19
|
+
'aria-label': ariaLabel,
|
|
20
|
+
class: classProp = '',
|
|
21
|
+
className = '',
|
|
22
|
+
defaultValue,
|
|
23
|
+
name = 'segmented',
|
|
24
|
+
options = [],
|
|
25
|
+
size = 'default',
|
|
26
|
+
value = defaultValue,
|
|
27
|
+
...rest
|
|
28
|
+
} = Astro.props
|
|
29
|
+
|
|
30
|
+
const normalized = options.map(option =>
|
|
31
|
+
typeof option === 'string' ? { disabled: false, label: option, value: option } : option
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
35
|
+
'ui-segmented',
|
|
36
|
+
size === 'sm' && 'ui-segmented--sm',
|
|
37
|
+
size === 'lg' && 'ui-segmented--lg'
|
|
38
|
+
], classProp, className)
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
<div aria-label={ariaLabel} class:list={classList} role="group" {...passthrough}>
|
|
42
|
+
{normalized.map(option => (
|
|
43
|
+
<label class="ui-segmented__option">
|
|
44
|
+
<input
|
|
45
|
+
checked={value === option.value}
|
|
46
|
+
class="ui-segmented__input"
|
|
47
|
+
disabled={option.disabled}
|
|
48
|
+
name={name}
|
|
49
|
+
type="radio"
|
|
50
|
+
value={option.value}
|
|
51
|
+
/>
|
|
52
|
+
<span class="ui-segmented__label">{option.label}</span>
|
|
53
|
+
</label>
|
|
54
|
+
))}
|
|
55
|
+
<slot />
|
|
56
|
+
</div>
|
|
@@ -0,0 +1,120 @@
|
|
|
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
|
+
glass?: boolean | 'subtle' | 'strong'
|
|
18
|
+
options?: SelectOption[]
|
|
19
|
+
placeholder?: string
|
|
20
|
+
size?: 'default' | 'lg' | 'md' | 'sm'
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const {
|
|
24
|
+
class: classProp = '',
|
|
25
|
+
className = '',
|
|
26
|
+
disabled = false,
|
|
27
|
+
glass = false,
|
|
28
|
+
id,
|
|
29
|
+
name,
|
|
30
|
+
options = [],
|
|
31
|
+
placeholder,
|
|
32
|
+
required = false,
|
|
33
|
+
size = 'default',
|
|
34
|
+
value,
|
|
35
|
+
...rest
|
|
36
|
+
} = Astro.props
|
|
37
|
+
|
|
38
|
+
const normalizedOptions = options.map(option =>
|
|
39
|
+
typeof option === 'string' ? { label: option, value: option } : option
|
|
40
|
+
)
|
|
41
|
+
const selectedValue = value === undefined || value === null ? undefined : String(value)
|
|
42
|
+
const hasSelectedValue = selectedValue !== undefined && selectedValue !== ''
|
|
43
|
+
const selectedOption = normalizedOptions.find(option => String(option.value) === selectedValue)
|
|
44
|
+
const selectId = id ?? `ui-select-${Math.random().toString(36).slice(2)}`
|
|
45
|
+
const triggerId = `${selectId}-trigger`
|
|
46
|
+
const listId = `${selectId}-listbox`
|
|
47
|
+
const placeholderText = placeholder ?? 'Select an option'
|
|
48
|
+
const triggerText = hasSelectedValue ? selectedOption?.label ?? placeholderText : placeholderText
|
|
49
|
+
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
50
|
+
'ui-select-field',
|
|
51
|
+
glass && 'ui-select-field--glass',
|
|
52
|
+
glass === 'subtle' && 'ui-glass-subtle',
|
|
53
|
+
glass === 'strong' && 'ui-glass-strong'
|
|
54
|
+
], classProp, className)
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
<div
|
|
58
|
+
class:list={classList}
|
|
59
|
+
data-placeholder={hasSelectedValue ? 'false' : 'true'}
|
|
60
|
+
data-ui-glass-track={glass ? true : undefined}
|
|
61
|
+
data-ui-select
|
|
62
|
+
>
|
|
63
|
+
<select
|
|
64
|
+
class:list={[
|
|
65
|
+
'ui-select',
|
|
66
|
+
'ui-select__native',
|
|
67
|
+
size === 'sm' && 'ui-select--sm',
|
|
68
|
+
size === 'lg' && 'ui-select--lg'
|
|
69
|
+
]}
|
|
70
|
+
data-ui-select-native
|
|
71
|
+
disabled={disabled}
|
|
72
|
+
id={selectId}
|
|
73
|
+
name={name}
|
|
74
|
+
required={required}
|
|
75
|
+
{...passthrough}
|
|
76
|
+
>
|
|
77
|
+
{placeholder && <option data-ui-select-placeholder disabled selected={!hasSelectedValue} value="">{placeholder}</option>}
|
|
78
|
+
<slot />
|
|
79
|
+
{normalizedOptions.map(option => (
|
|
80
|
+
<option disabled={option.disabled} selected={selectedValue === String(option.value)} value={option.value}>{option.label}</option>
|
|
81
|
+
))}
|
|
82
|
+
</select>
|
|
83
|
+
|
|
84
|
+
<div class="ui-select__control" data-ui-select-control hidden>
|
|
85
|
+
<button
|
|
86
|
+
aria-controls={listId}
|
|
87
|
+
aria-expanded="false"
|
|
88
|
+
aria-haspopup="listbox"
|
|
89
|
+
class:list={[
|
|
90
|
+
'ui-select',
|
|
91
|
+
'ui-select__trigger',
|
|
92
|
+
size === 'sm' && 'ui-select--sm',
|
|
93
|
+
size === 'lg' && 'ui-select--lg'
|
|
94
|
+
]}
|
|
95
|
+
data-ui-select-trigger
|
|
96
|
+
disabled={disabled}
|
|
97
|
+
id={triggerId}
|
|
98
|
+
role="combobox"
|
|
99
|
+
type="button"
|
|
100
|
+
>
|
|
101
|
+
<span data-ui-select-value>{triggerText}</span>
|
|
102
|
+
</button>
|
|
103
|
+
|
|
104
|
+
<div class="ui-select__list" data-state="closed" data-ui-select-list hidden id={listId} role="listbox">
|
|
105
|
+
{normalizedOptions.map(option => (
|
|
106
|
+
<button
|
|
107
|
+
aria-disabled={option.disabled ? 'true' : undefined}
|
|
108
|
+
aria-selected={selectedValue === String(option.value) ? 'true' : 'false'}
|
|
109
|
+
data-ui-select-option
|
|
110
|
+
data-value={option.value}
|
|
111
|
+
disabled={option.disabled}
|
|
112
|
+
role="option"
|
|
113
|
+
type="button"
|
|
114
|
+
>
|
|
115
|
+
{option.label}
|
|
116
|
+
</button>
|
|
117
|
+
))}
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
3
|
+
|
|
4
|
+
import type { HTMLAttributes } from 'astro/types'
|
|
5
|
+
|
|
6
|
+
interface Props extends HTMLAttributes<'hr'> {
|
|
7
|
+
class?: string
|
|
8
|
+
className?: string
|
|
9
|
+
orientation?: 'horizontal' | 'vertical'
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const {
|
|
13
|
+
class: classProp = '',
|
|
14
|
+
className = '',
|
|
15
|
+
orientation = 'horizontal',
|
|
16
|
+
...rest
|
|
17
|
+
} = Astro.props
|
|
18
|
+
|
|
19
|
+
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
20
|
+
'ui-separator',
|
|
21
|
+
orientation === 'horizontal' && 'ui-separator--horizontal',
|
|
22
|
+
orientation === 'vertical' && 'ui-separator--vertical'
|
|
23
|
+
], classProp, className)
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
<hr
|
|
27
|
+
aria-orientation={orientation}
|
|
28
|
+
class:list={classList}
|
|
29
|
+
data-orientation={orientation}
|
|
30
|
+
{...passthrough}
|
|
31
|
+
/>
|
|
@@ -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-sheet',
|
|
27
|
+
resolvedGlass && 'ui-sheet--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-sheet
|
|
36
|
+
class:list={classList}
|
|
37
|
+
{...passthrough}
|
|
38
|
+
>
|
|
39
|
+
<slot />
|
|
40
|
+
</dialog>
|
|
@@ -0,0 +1,39 @@
|
|
|
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-sidebar',
|
|
27
|
+
resolvedGlass && 'ui-sidebar--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
|
+
class:list={classList}
|
|
36
|
+
{...passthrough}
|
|
37
|
+
>
|
|
38
|
+
<slot />
|
|
39
|
+
</aside>
|
|
@@ -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
|
+
}
|
|
10
|
+
|
|
11
|
+
const {
|
|
12
|
+
'aria-hidden': ariaHidden,
|
|
13
|
+
'aria-label': ariaLabel,
|
|
14
|
+
'aria-labelledby': ariaLabelledby,
|
|
15
|
+
class: classProp = '',
|
|
16
|
+
className = '',
|
|
17
|
+
role,
|
|
18
|
+
...rest
|
|
19
|
+
} = Astro.props
|
|
20
|
+
|
|
21
|
+
const isAccessible = Boolean(ariaLabel || ariaLabelledby)
|
|
22
|
+
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
23
|
+
'ui-skeleton'
|
|
24
|
+
], classProp, className)
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
<div
|
|
28
|
+
aria-hidden={ariaHidden ?? (isAccessible ? undefined : 'true')}
|
|
29
|
+
aria-label={ariaLabel}
|
|
30
|
+
aria-labelledby={ariaLabelledby}
|
|
31
|
+
class:list={classList}
|
|
32
|
+
role={role ?? (isAccessible ? 'status' : undefined)}
|
|
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<'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-skip-link'
|
|
19
|
+
], classProp, className)
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
<a
|
|
23
|
+
class:list={classList}
|
|
24
|
+
{...passthrough}
|
|
25
|
+
>
|
|
26
|
+
<slot />
|
|
27
|
+
</a>
|
|
@@ -0,0 +1,20 @@
|
|
|
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 = 'range', ...rest } = Astro.props
|
|
12
|
+
const { classList, passthrough } = resolveLumenAstroProps(rest, ['ui-slider'
|
|
13
|
+
], classProp, className)
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
<input
|
|
17
|
+
class:list={classList}
|
|
18
|
+
type={type}
|
|
19
|
+
{...passthrough}
|
|
20
|
+
/>
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
maxCount?: number
|
|
10
|
+
placement?: 'bottom-center' | 'bottom-left' | 'bottom-right' | 'top-center' | 'top-left' | 'top-right'
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const {
|
|
14
|
+
'aria-atomic': ariaAtomic = 'false',
|
|
15
|
+
'aria-live': ariaLive = 'polite',
|
|
16
|
+
class: classProp = '',
|
|
17
|
+
className = '',
|
|
18
|
+
maxCount,
|
|
19
|
+
placement = 'bottom-right',
|
|
20
|
+
...rest
|
|
21
|
+
} = Astro.props
|
|
22
|
+
|
|
23
|
+
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
24
|
+
'ui-sonner'
|
|
25
|
+
], classProp, className)
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
<div
|
|
29
|
+
aria-atomic={ariaAtomic}
|
|
30
|
+
aria-live={ariaLive}
|
|
31
|
+
data-ui-sonner
|
|
32
|
+
data-ui-toast-max={maxCount}
|
|
33
|
+
data-placement={placement}
|
|
34
|
+
class:list={classList}
|
|
35
|
+
{...passthrough}
|
|
36
|
+
>
|
|
37
|
+
<slot />
|
|
38
|
+
</div>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
import {
|
|
3
|
+
renderLumenIconSvg,
|
|
4
|
+
resolveLumenAstroProps
|
|
5
|
+
} from '@santi020k/lumen-core'
|
|
6
|
+
|
|
7
|
+
import type { HTMLAttributes } from 'astro/types'
|
|
8
|
+
|
|
9
|
+
type SpeedDialAction = { icon?: string; label: string; value?: string }
|
|
10
|
+
|
|
11
|
+
interface Props extends HTMLAttributes<'div'> {
|
|
12
|
+
actions?: SpeedDialAction[]
|
|
13
|
+
class?: string
|
|
14
|
+
className?: string
|
|
15
|
+
defaultOpen?: boolean
|
|
16
|
+
direction?: 'up' | 'down' | 'left' | 'right'
|
|
17
|
+
label?: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const {
|
|
21
|
+
actions = [],
|
|
22
|
+
class: classProp = '',
|
|
23
|
+
className = '',
|
|
24
|
+
defaultOpen = false,
|
|
25
|
+
direction = 'up',
|
|
26
|
+
label = 'Actions',
|
|
27
|
+
...rest
|
|
28
|
+
} = Astro.props
|
|
29
|
+
|
|
30
|
+
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
31
|
+
'ui-speed-dial',
|
|
32
|
+
`ui-speed-dial--${direction}`
|
|
33
|
+
], classProp, className)
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
<div
|
|
37
|
+
class:list={classList}
|
|
38
|
+
data-direction={direction}
|
|
39
|
+
data-state={defaultOpen ? 'open' : 'closed'}
|
|
40
|
+
data-ui-speed-dial
|
|
41
|
+
{...passthrough}
|
|
42
|
+
>
|
|
43
|
+
<button
|
|
44
|
+
aria-expanded={defaultOpen ? 'true' : 'false'}
|
|
45
|
+
aria-haspopup="menu"
|
|
46
|
+
aria-label={label}
|
|
47
|
+
class="ui-speed-dial__trigger"
|
|
48
|
+
data-ui-speed-dial-trigger
|
|
49
|
+
type="button"
|
|
50
|
+
>
|
|
51
|
+
<span aria-hidden="true" class="ui-speed-dial__icon"></span>
|
|
52
|
+
</button>
|
|
53
|
+
<menu aria-label={label} class="ui-speed-dial__actions" data-ui-speed-dial-actions role="menu">
|
|
54
|
+
{actions.map((action, index) => (
|
|
55
|
+
<li role="presentation" style={`--ui-speed-dial-index: ${index}`}>
|
|
56
|
+
<button
|
|
57
|
+
aria-label={action.label}
|
|
58
|
+
class="ui-speed-dial__action"
|
|
59
|
+
data-icon={action.icon}
|
|
60
|
+
data-value={action.value ?? action.label}
|
|
61
|
+
role="menuitem"
|
|
62
|
+
type="button"
|
|
63
|
+
>
|
|
64
|
+
{action.icon && (
|
|
65
|
+
<span
|
|
66
|
+
aria-hidden="true"
|
|
67
|
+
class="ui-speed-dial__action-icon ui-icon"
|
|
68
|
+
set:html={renderLumenIconSvg(action.icon)}
|
|
69
|
+
/>
|
|
70
|
+
)}
|
|
71
|
+
<span class="ui-speed-dial__action-label">{action.label}</span>
|
|
72
|
+
</button>
|
|
73
|
+
</li>
|
|
74
|
+
))}
|
|
75
|
+
<slot />
|
|
76
|
+
</menu>
|
|
77
|
+
</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<'span'> {
|
|
7
|
+
class?: string
|
|
8
|
+
className?: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const {
|
|
12
|
+
'aria-hidden': ariaHidden,
|
|
13
|
+
'aria-label': ariaLabel,
|
|
14
|
+
'aria-labelledby': ariaLabelledby,
|
|
15
|
+
class: classProp = '',
|
|
16
|
+
className = '',
|
|
17
|
+
role,
|
|
18
|
+
...rest
|
|
19
|
+
} = Astro.props
|
|
20
|
+
|
|
21
|
+
const isAccessible = Boolean(ariaLabel || ariaLabelledby)
|
|
22
|
+
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
23
|
+
'ui-spinner'
|
|
24
|
+
], classProp, className)
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
<span
|
|
28
|
+
aria-hidden={ariaHidden ?? (isAccessible ? undefined : 'true')}
|
|
29
|
+
aria-label={ariaLabel}
|
|
30
|
+
aria-labelledby={ariaLabelledby}
|
|
31
|
+
class:list={classList}
|
|
32
|
+
role={role ?? (isAccessible ? 'status' : undefined)}
|
|
33
|
+
{...passthrough}
|
|
34
|
+
>
|
|
35
|
+
<slot />
|
|
36
|
+
</span>
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
label?: string
|
|
10
|
+
value?: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const {
|
|
14
|
+
class: classProp = '',
|
|
15
|
+
className = '',
|
|
16
|
+
label,
|
|
17
|
+
value,
|
|
18
|
+
...rest
|
|
19
|
+
} = Astro.props
|
|
20
|
+
|
|
21
|
+
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
22
|
+
'ui-stat'
|
|
23
|
+
], classProp, className)
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
<div
|
|
27
|
+
class:list={classList}
|
|
28
|
+
{...passthrough}
|
|
29
|
+
>
|
|
30
|
+
{label && <div class="ui-stat-label">{label}</div>}
|
|
31
|
+
{value && <div class="ui-stat-value">{value}</div>}
|
|
32
|
+
<slot />
|
|
33
|
+
</div>
|
|
34
|
+
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
3
|
+
|
|
4
|
+
import type { HTMLAttributes } from 'astro/types'
|
|
5
|
+
|
|
6
|
+
type StepItem = string | { description?: string; title: string }
|
|
7
|
+
|
|
8
|
+
interface Props extends HTMLAttributes<'ol'> {
|
|
9
|
+
class?: string
|
|
10
|
+
className?: string
|
|
11
|
+
currentStep?: number
|
|
12
|
+
orientation?: 'horizontal' | 'vertical'
|
|
13
|
+
steps?: StepItem[]
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const {
|
|
17
|
+
class: classProp = '',
|
|
18
|
+
className = '',
|
|
19
|
+
currentStep = 0,
|
|
20
|
+
orientation = 'horizontal',
|
|
21
|
+
steps = [],
|
|
22
|
+
...rest
|
|
23
|
+
} = Astro.props
|
|
24
|
+
|
|
25
|
+
const normalized = steps.map(step =>
|
|
26
|
+
typeof step === 'string' ? { description: undefined, title: step } : step
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
const stepState = (index: number) =>
|
|
30
|
+
index < currentStep ? 'complete' : index === currentStep ? 'current' : 'upcoming'
|
|
31
|
+
|
|
32
|
+
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
33
|
+
'ui-stepper',
|
|
34
|
+
orientation === 'vertical' && 'ui-stepper--vertical'
|
|
35
|
+
], classProp, className)
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
<ol
|
|
39
|
+
class:list={classList}
|
|
40
|
+
data-orientation={orientation}
|
|
41
|
+
{...passthrough}
|
|
42
|
+
>
|
|
43
|
+
{normalized.map((step, index) => (
|
|
44
|
+
<li
|
|
45
|
+
aria-current={stepState(index) === 'current' ? 'step' : undefined}
|
|
46
|
+
class="ui-stepper__step"
|
|
47
|
+
data-state={stepState(index)}
|
|
48
|
+
>
|
|
49
|
+
<span class="ui-stepper__marker">{index + 1}</span>
|
|
50
|
+
<span class="ui-stepper__content">
|
|
51
|
+
<span class="ui-stepper__title">{step.title}</span>
|
|
52
|
+
{step.description && <span class="ui-stepper__description">{step.description}</span>}
|
|
53
|
+
</span>
|
|
54
|
+
</li>
|
|
55
|
+
))}
|
|
56
|
+
<slot />
|
|
57
|
+
</ol>
|