@santi020k/lumen-astro 0.4.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 +44 -6
- 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 +18 -4
- 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 +76 -50
- 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 +9 -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 +52 -35
- 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 +13 -3
- package/components/PasswordField.astro +73 -0
- package/components/PhoneInput.astro +5 -7
- package/components/PieChart.astro +16 -13
- package/components/Pill.astro +11 -8
- 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 +2 -2
- 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 +9 -9
- package/components/SpeedDial.astro +3 -3
- package/components/Spinner.astro +4 -3
- package/components/Stack.astro +46 -0
- package/components/Stat.astro +6 -5
- 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 +10 -6
- package/forms.ts +46 -0
- package/index.ts +26 -0
- package/package.json +12 -8
- package/runtime/UIPrimitives.astro +3755 -3176
- package/runtime/controllers/motion.ts +13 -16
- package/index.d.ts +0 -131
|
@@ -0,0 +1,26 @@
|
|
|
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' | 'h2' | 'h3' | 'h4'
|
|
8
|
+
class?: string | null
|
|
9
|
+
className?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const {
|
|
13
|
+
as: Tag = 'div',
|
|
14
|
+
class: classProp = '',
|
|
15
|
+
className = '',
|
|
16
|
+
...rest
|
|
17
|
+
} = Astro.props
|
|
18
|
+
|
|
19
|
+
const { classList, passthrough } = resolveLumenAstroProps(
|
|
20
|
+
rest, ['ui-card__title'], classProp, className
|
|
21
|
+
)
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
<Tag class:list={classList} data-slot="card-title" {...passthrough}>
|
|
25
|
+
<slot />
|
|
26
|
+
</Tag>
|
|
@@ -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-carousel',
|
|
21
|
+
glass && 'ui-carousel--glass',
|
|
22
|
+
glass === 'subtle' && 'ui-glass-subtle',
|
|
23
|
+
glass === 'strong' && 'ui-glass-strong'
|
|
24
24
|
], classProp, className)
|
|
25
25
|
---
|
|
26
26
|
|
|
@@ -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 CascaderOption {
|
|
7
7
|
children?: CascaderOption[]
|
|
8
8
|
label: string
|
|
@@ -28,7 +28,7 @@ const {
|
|
|
28
28
|
|
|
29
29
|
interface RenderedColumn {
|
|
30
30
|
id: string
|
|
31
|
-
options: { label: string
|
|
31
|
+
options: { label: string, nextId?: string | undefined, value: string }[]
|
|
32
32
|
root: boolean
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -83,7 +83,13 @@ const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
|
83
83
|
</button>
|
|
84
84
|
<div class="ui-cascader__panel" data-ui-panel hidden id={panelId}>
|
|
85
85
|
{columns.map(column => (
|
|
86
|
-
<ol
|
|
86
|
+
<ol
|
|
87
|
+
aria-label={column.root ? 'Options' : 'Sub-options'}
|
|
88
|
+
class="ui-cascader__column"
|
|
89
|
+
hidden={!column.root}
|
|
90
|
+
id={column.id}
|
|
91
|
+
role="listbox"
|
|
92
|
+
>
|
|
87
93
|
{column.options.map(option => (
|
|
88
94
|
<li role="presentation">
|
|
89
95
|
<button
|
package/components/Chart.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<'figure'> {
|
|
7
7
|
caption?: string
|
|
8
8
|
class?: string | null
|
|
@@ -10,6 +10,7 @@ interface Props extends HTMLAttributes<'figure'> {
|
|
|
10
10
|
description?: string
|
|
11
11
|
glass?: boolean | 'subtle' | 'strong'
|
|
12
12
|
heading?: string
|
|
13
|
+
presentation?: 'bare' | 'default'
|
|
13
14
|
value?: string
|
|
14
15
|
}
|
|
15
16
|
|
|
@@ -20,15 +21,17 @@ const {
|
|
|
20
21
|
description,
|
|
21
22
|
glass = false,
|
|
22
23
|
heading,
|
|
24
|
+
presentation = 'default',
|
|
23
25
|
value,
|
|
24
26
|
...rest
|
|
25
27
|
} = Astro.props
|
|
26
28
|
|
|
27
29
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
'ui-chart',
|
|
31
|
+
presentation === 'bare' && 'ui-chart--bare',
|
|
32
|
+
glass && 'ui-chart--glass',
|
|
33
|
+
glass === 'subtle' && 'ui-glass-subtle',
|
|
34
|
+
glass === 'strong' && 'ui-glass-strong'
|
|
32
35
|
], classProp, className)
|
|
33
36
|
---
|
|
34
37
|
|
|
@@ -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
|
type HTMLInputAttributes = HTMLAttributes<'input'>
|
|
7
7
|
|
|
8
8
|
interface Props extends Omit<HTMLInputAttributes, 'type'> {
|
|
@@ -11,6 +11,7 @@ interface Props extends Omit<HTMLInputAttributes, 'type'> {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
const { class: classProp = '', className = '', ...rest } = Astro.props
|
|
14
|
+
|
|
14
15
|
const { classList, passthrough } = resolveLumenAstroProps(rest, ['ui-checkbox'
|
|
15
16
|
], classProp, className)
|
|
16
17
|
---
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types'
|
|
3
|
+
|
|
4
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
5
|
+
|
|
6
|
+
interface Props extends HTMLAttributes<'fieldset'> {
|
|
7
|
+
class?: string | null
|
|
8
|
+
className?: string
|
|
9
|
+
invalid?: boolean
|
|
10
|
+
legend?: string
|
|
11
|
+
orientation?: 'horizontal' | 'vertical'
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const {
|
|
15
|
+
class: classProp = '',
|
|
16
|
+
className = '',
|
|
17
|
+
invalid = false,
|
|
18
|
+
legend,
|
|
19
|
+
orientation = 'vertical',
|
|
20
|
+
...rest
|
|
21
|
+
} = Astro.props
|
|
22
|
+
|
|
23
|
+
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
24
|
+
'ui-checkbox-group',
|
|
25
|
+
`ui-checkbox-group--${orientation}`
|
|
26
|
+
], classProp, className)
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
<fieldset
|
|
30
|
+
aria-invalid={invalid ? 'true' : undefined}
|
|
31
|
+
class:list={classList}
|
|
32
|
+
data-invalid={invalid ? 'true' : undefined}
|
|
33
|
+
data-orientation={orientation}
|
|
34
|
+
data-ui-checkbox-group
|
|
35
|
+
{...passthrough}
|
|
36
|
+
>
|
|
37
|
+
{legend && <legend>{legend}</legend>}
|
|
38
|
+
<slot />
|
|
39
|
+
</fieldset>
|
package/components/Code.astro
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { renderLumenCodeHtml, renderLumenIconSvg, resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
3
|
-
|
|
4
2
|
import type { HTMLAttributes } from 'astro/types'
|
|
5
3
|
|
|
4
|
+
import { renderLumenCodeHtml, renderLumenIconSvg, resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
5
|
+
|
|
6
6
|
type CodeTheme = 'auto' | 'lumen' | 'santi020k'
|
|
7
|
+
|
|
7
8
|
type CodeVariant = 'block' | 'inline'
|
|
8
9
|
|
|
9
10
|
interface Props extends HTMLAttributes<'code'> {
|
|
@@ -38,62 +39,64 @@ const { classList: blockClassList, passthrough } = resolveLumenAstroProps(rest,
|
|
|
38
39
|
'ui-code--block',
|
|
39
40
|
wrap && 'ui-code--wrap'
|
|
40
41
|
], classProp, className)
|
|
42
|
+
|
|
41
43
|
const { classList: inlineClassList } = resolveLumenAstroProps(rest, [
|
|
42
44
|
'ui-code',
|
|
43
45
|
'ui-code--inline'
|
|
44
46
|
], classProp, className)
|
|
47
|
+
|
|
45
48
|
const shouldShowHeader = variant === 'block' && Boolean(copy || label || language)
|
|
46
49
|
const hasCode = code !== undefined
|
|
47
50
|
const renderedCode = hasCode ? renderLumenCodeHtml(code, language) : ''
|
|
48
51
|
---
|
|
49
52
|
|
|
50
|
-
{variant === 'block' ?
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
<span class="ui-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
<pre><code set:html={renderedCode}></code></pre>
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
)}
|
|
53
|
+
{variant === 'block' ?
|
|
54
|
+
(
|
|
55
|
+
<figure
|
|
56
|
+
class:list={blockClassList}
|
|
57
|
+
data-code-theme={theme}
|
|
58
|
+
data-language={language}
|
|
59
|
+
data-slot="code"
|
|
60
|
+
data-ui-code
|
|
61
|
+
{...passthrough}
|
|
62
|
+
>
|
|
63
|
+
{shouldShowHeader && (
|
|
64
|
+
<figcaption class="ui-code__header">
|
|
65
|
+
<span class="ui-code__dots" aria-hidden="true">
|
|
66
|
+
<span class="ui-code__dot ui-code__dot--red"></span>
|
|
67
|
+
<span class="ui-code__dot ui-code__dot--yellow"></span>
|
|
68
|
+
<span class="ui-code__dot ui-code__dot--green"></span>
|
|
69
|
+
</span>
|
|
70
|
+
<span class="ui-code__meta">
|
|
71
|
+
{language && <span class="ui-code__language">{language}</span>}
|
|
72
|
+
{label && <span class="ui-code__label">{label}</span>}
|
|
73
|
+
</span>
|
|
74
|
+
{copy && (
|
|
75
|
+
<button
|
|
76
|
+
aria-label="Copy code to clipboard"
|
|
77
|
+
class="ui-code__copy"
|
|
78
|
+
data-ui-code-copy
|
|
79
|
+
type="button"
|
|
80
|
+
>
|
|
81
|
+
<Fragment set:html={renderLumenIconSvg('copy', { className: 'ui-code__copy-icon' })} />
|
|
82
|
+
<Fragment set:html={renderLumenIconSvg('check', { className: 'ui-code__check-icon' })} />
|
|
83
|
+
</button>
|
|
84
|
+
)}
|
|
85
|
+
</figcaption>
|
|
86
|
+
)}
|
|
87
|
+
{highlighted && <slot />}
|
|
88
|
+
{!highlighted && hasCode && <pre><code set:html={renderedCode}></code></pre>}
|
|
89
|
+
{!highlighted && !hasCode && <pre><code><slot /></code></pre>}
|
|
90
|
+
</figure>
|
|
91
|
+
) :
|
|
92
|
+
(
|
|
93
|
+
<code
|
|
94
|
+
class:list={inlineClassList}
|
|
95
|
+
data-code-theme={theme}
|
|
96
|
+
data-language={language}
|
|
97
|
+
data-slot="code"
|
|
98
|
+
{...passthrough}
|
|
99
|
+
>
|
|
100
|
+
{hasCode ? code : <slot />}
|
|
101
|
+
</code>
|
|
102
|
+
)}
|
|
@@ -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
|
import Code from './Code.astro'
|
|
7
7
|
import Tabs from './Tabs.astro'
|
|
8
8
|
|
|
@@ -41,20 +41,20 @@ const {
|
|
|
41
41
|
} = Astro.props
|
|
42
42
|
|
|
43
43
|
const selectedValue = initialValue ?? items[0]?.value
|
|
44
|
+
|
|
44
45
|
const tabsStateProps = {
|
|
45
46
|
...(selectedValue === undefined ? {} : { initialValue: selectedValue }),
|
|
46
47
|
...(storageKey === undefined ? {} : { storageKey })
|
|
47
48
|
}
|
|
49
|
+
|
|
48
50
|
const { classList, passthrough } = resolveLumenAstroProps(
|
|
49
|
-
rest,
|
|
50
|
-
['ui-code-tabs'],
|
|
51
|
-
classProp ?? '',
|
|
52
|
-
className
|
|
51
|
+
rest, ['ui-code-tabs'], classProp ?? '', className
|
|
53
52
|
)
|
|
54
53
|
---
|
|
55
54
|
|
|
56
55
|
<Tabs
|
|
57
56
|
class:list={classList}
|
|
57
|
+
data-slot="code-tabs"
|
|
58
58
|
{...tabsStateProps}
|
|
59
59
|
{...passthrough}
|
|
60
60
|
>
|
|
@@ -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<'details'> {
|
|
7
7
|
class?: string | null
|
|
8
8
|
className?: string
|
|
@@ -15,7 +15,7 @@ const {
|
|
|
15
15
|
} = Astro.props
|
|
16
16
|
|
|
17
17
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
18
|
-
|
|
18
|
+
'ui-collapsible'
|
|
19
19
|
], classProp, className)
|
|
20
20
|
---
|
|
21
21
|
|
|
@@ -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<'input'> {
|
|
7
7
|
class?: string | null
|
|
8
8
|
className?: string
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
const { class: classProp = '', className = '', type = 'color', ...rest } = Astro.props
|
|
12
|
+
|
|
12
13
|
const { classList, passthrough } = resolveLumenAstroProps(rest, ['ui-color-picker'
|
|
13
14
|
], classProp, className)
|
|
14
15
|
---
|
|
@@ -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<'input'> {
|
|
7
7
|
class?: string | null
|
|
8
8
|
className?: string
|
|
@@ -31,9 +31,8 @@ const {
|
|
|
31
31
|
} = Astro.props
|
|
32
32
|
|
|
33
33
|
const inputId = id ?? `${list}-input`
|
|
34
|
-
const normalizedOptions = options.map(option =>
|
|
35
|
-
|
|
36
|
-
)
|
|
34
|
+
const normalizedOptions = options.map(option => typeof option === 'string' ? { label: option, value: option } : option)
|
|
35
|
+
|
|
37
36
|
const { classList, passthrough } = resolveLumenAstroProps(rest, ['ui-combobox'
|
|
38
37
|
], classProp, className)
|
|
39
38
|
---
|
package/components/Command.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
|
|
@@ -17,10 +17,10 @@ const {
|
|
|
17
17
|
} = Astro.props
|
|
18
18
|
|
|
19
19
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
'ui-command',
|
|
21
|
+
glass && 'ui-command--glass',
|
|
22
|
+
glass === 'subtle' && 'ui-glass-subtle',
|
|
23
|
+
glass === 'strong' && 'ui-glass-strong'
|
|
24
24
|
], classProp, className)
|
|
25
25
|
---
|
|
26
26
|
|
|
@@ -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<'div'> {
|
|
7
|
+
as?: 'article' | 'div' | 'main' | 'section'
|
|
8
|
+
class?: string | null
|
|
9
|
+
className?: string
|
|
10
|
+
size?: 'full' | 'lg' | 'md' | 'sm'
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const {
|
|
14
|
+
as: Tag = 'div',
|
|
15
|
+
class: classProp = '',
|
|
16
|
+
className = '',
|
|
17
|
+
size = 'lg',
|
|
18
|
+
...rest
|
|
19
|
+
} = Astro.props
|
|
20
|
+
|
|
21
|
+
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
22
|
+
'ui-container',
|
|
23
|
+
`ui-container--${size}`
|
|
24
|
+
], classProp, className)
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
<Tag class:list={classList} data-size={size} data-ui-container {...passthrough}>
|
|
28
|
+
<slot />
|
|
29
|
+
</Tag>
|
|
@@ -1,32 +1,26 @@
|
|
|
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<'menu'> {
|
|
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
|
|
|
@@ -34,7 +28,7 @@ const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
|
34
28
|
to get right-click / Shift+F10 open behavior from the runtime. Without a
|
|
35
29
|
trigger the menu renders statically. */}
|
|
36
30
|
<menu
|
|
37
|
-
data-surface={
|
|
31
|
+
data-surface={glass ? 'glass' : 'default'}
|
|
38
32
|
data-ui-context-menu
|
|
39
33
|
role="menu"
|
|
40
34
|
class:list={classList}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types'
|
|
3
|
+
|
|
4
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
5
|
+
|
|
6
|
+
interface Props extends HTMLAttributes<'button'> {
|
|
7
|
+
class?: string | null
|
|
8
|
+
className?: string
|
|
9
|
+
copiedLabel?: string
|
|
10
|
+
errorLabel?: string
|
|
11
|
+
label?: string
|
|
12
|
+
resetAfter?: number
|
|
13
|
+
target?: string
|
|
14
|
+
toast?: boolean
|
|
15
|
+
value?: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const {
|
|
19
|
+
class: classProp = '',
|
|
20
|
+
className = '',
|
|
21
|
+
copiedLabel = 'Copied to clipboard',
|
|
22
|
+
errorLabel = 'Could not copy to clipboard',
|
|
23
|
+
label = 'Copy to clipboard',
|
|
24
|
+
resetAfter = 2000,
|
|
25
|
+
target,
|
|
26
|
+
toast = false,
|
|
27
|
+
type = 'button',
|
|
28
|
+
value,
|
|
29
|
+
...rest
|
|
30
|
+
} = Astro.props
|
|
31
|
+
|
|
32
|
+
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
33
|
+
'ui-button',
|
|
34
|
+
'ui-button--outline',
|
|
35
|
+
'ui-copy-button'
|
|
36
|
+
], classProp, className)
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
<button
|
|
40
|
+
aria-label={label}
|
|
41
|
+
class:list={classList}
|
|
42
|
+
data-copy-copied-label={copiedLabel}
|
|
43
|
+
data-copy-error-label={errorLabel}
|
|
44
|
+
data-copy-label={label}
|
|
45
|
+
data-copy-reset-after={Math.max(0, resetAfter)}
|
|
46
|
+
data-copy-target={target}
|
|
47
|
+
data-copy-toast={toast ? 'true' : undefined}
|
|
48
|
+
data-copy-value={value}
|
|
49
|
+
data-state="idle"
|
|
50
|
+
data-ui-copy-button
|
|
51
|
+
type={type}
|
|
52
|
+
{...passthrough}
|
|
53
|
+
>
|
|
54
|
+
<slot>Copy</slot>
|
|
55
|
+
</button>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
3
2
|
import type { ImageMetadata } from 'astro'
|
|
3
|
+
import type { HTMLAttributes } from 'astro/types'
|
|
4
|
+
|
|
4
5
|
import { Picture } from 'astro:assets'
|
|
5
6
|
|
|
6
|
-
import
|
|
7
|
+
import { resolveLumenAstroProps } from '@santi020k/lumen-core'
|
|
7
8
|
|
|
8
9
|
interface Props extends HTMLAttributes<'div'> {
|
|
9
10
|
alt: string
|
|
@@ -64,19 +65,22 @@ if (orientation === 'portrait') {
|
|
|
64
65
|
let cardWrapperClass = `${cardAspectClass} rounded-t-[1.75rem] border-b border-line/45`
|
|
65
66
|
|
|
66
67
|
if (featured && orientation === 'landscape') {
|
|
67
|
-
cardWrapperClass =
|
|
68
|
+
cardWrapperClass = 'aspect-16/10 rounded-t-[1.75rem] border-b border-line/45'
|
|
68
69
|
} else if (useContainedFrame) {
|
|
69
|
-
cardWrapperClass =
|
|
70
|
+
cardWrapperClass = [
|
|
71
|
+
`${cardAspectClass} rounded-t-[1.75rem] flex items-center justify-center`,
|
|
72
|
+
'border-b border-line/45 bg-linear-to-br from-surface-muted',
|
|
73
|
+
'via-surface to-brand-soft/30 p-4 sm:p-5'
|
|
74
|
+
].join(' ')
|
|
70
75
|
}
|
|
71
76
|
|
|
72
77
|
let detailWrapperClass = 'w-full'
|
|
73
78
|
let detailImageClass = 'size-full object-contain'
|
|
74
79
|
let detailWrapperStyle: string | undefined
|
|
75
|
-
|
|
76
|
-
let cardImageClass = `size-full object-cover motion-safe:group-hover:scale-[1.03]`
|
|
80
|
+
let cardImageClass = 'size-full object-cover motion-safe:group-hover:scale-[1.03]'
|
|
77
81
|
|
|
78
82
|
if (useContainedFrame) {
|
|
79
|
-
detailWrapperClass =
|
|
83
|
+
detailWrapperClass = 'flex min-h-[22rem] items-center justify-center bg-linear-to-br from-surface-muted via-surface to-brand-soft/35 p-4 sm:min-h-[28rem] sm:p-6 lg:min-h-[34rem] lg:p-8'
|
|
80
84
|
|
|
81
85
|
if (orientation === 'portrait') {
|
|
82
86
|
detailImageClass = 'mx-auto h-full w-auto max-w-full object-contain'
|
|
@@ -84,7 +88,7 @@ if (useContainedFrame) {
|
|
|
84
88
|
detailImageClass = 'mx-auto h-full w-full max-w-[34rem] object-contain'
|
|
85
89
|
}
|
|
86
90
|
|
|
87
|
-
cardImageClass =
|
|
91
|
+
cardImageClass = 'mx-auto h-full w-full object-contain motion-safe:group-hover:scale-[1.02]'
|
|
88
92
|
} else {
|
|
89
93
|
detailWrapperStyle = `aspect-ratio: ${image.width} / ${image.height};`
|
|
90
94
|
}
|
|
@@ -114,14 +118,17 @@ let targetHeight = 800
|
|
|
114
118
|
|
|
115
119
|
if (mode === 'detail') {
|
|
116
120
|
targetWidth = 1600
|
|
121
|
+
|
|
117
122
|
targetHeight = 1000
|
|
118
123
|
}
|
|
119
124
|
|
|
120
125
|
if (orientation === 'portrait') {
|
|
121
126
|
targetHeight = mode === 'detail' ? 1500 : 1280
|
|
127
|
+
|
|
122
128
|
targetWidth = Math.round(targetHeight * 0.8)
|
|
123
129
|
} else if (orientation === 'square') {
|
|
124
130
|
targetHeight = mode === 'detail' ? 1200 : 1024
|
|
131
|
+
|
|
125
132
|
targetWidth = targetHeight
|
|
126
133
|
}
|
|
127
134
|
|
|
@@ -167,7 +174,10 @@ const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
|
167
174
|
{mode === 'card' && !useContainedFrame && showCardOverlay && (
|
|
168
175
|
<div
|
|
169
176
|
aria-hidden="true"
|
|
170
|
-
class="
|
|
177
|
+
class="
|
|
178
|
+
from-canvas/55 via-canvas/10 absolute inset-0 bg-linear-to-t
|
|
179
|
+
to-transparent
|
|
180
|
+
"
|
|
171
181
|
/>
|
|
172
182
|
)}
|
|
173
183
|
|