@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,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> </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>
|