@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.
Files changed (158) hide show
  1. package/README.md +100 -2
  2. package/components/Accordion.astro +4 -4
  3. package/components/Affix.astro +2 -2
  4. package/components/Agenda.astro +3 -2
  5. package/components/Alert.astro +9 -9
  6. package/components/AlertDialog.astro +7 -13
  7. package/components/Anchor.astro +29 -3
  8. package/components/AnimatedLogo.astro +2 -1
  9. package/components/AnimatedNumber.astro +5 -2
  10. package/components/AnimatedPortrait.astro +46 -36
  11. package/components/AspectRatio.astro +10 -8
  12. package/components/Attachment.astro +24 -24
  13. package/components/Autocomplete.astro +3 -2
  14. package/components/Avatar.astro +4 -3
  15. package/components/BackToTop.astro +2 -2
  16. package/components/Badge.astro +9 -9
  17. package/components/BarChart.astro +211 -0
  18. package/components/Breadcrumb.astro +3 -3
  19. package/components/Bubble.astro +7 -7
  20. package/components/Button.astro +18 -16
  21. package/components/ButtonGroup.astro +3 -3
  22. package/components/ButtonLink.astro +9 -3
  23. package/components/Calendar.astro +43 -31
  24. package/components/Callout.astro +2 -2
  25. package/components/Card.astro +12 -10
  26. package/components/CardContent.astro +26 -0
  27. package/components/CardDescription.astro +26 -0
  28. package/components/CardFooter.astro +26 -0
  29. package/components/CardHeader.astro +26 -0
  30. package/components/CardTitle.astro +26 -0
  31. package/components/Carousel.astro +6 -6
  32. package/components/Cascader.astro +10 -4
  33. package/components/Chart.astro +32 -6
  34. package/components/Checkbox.astro +3 -2
  35. package/components/CheckboxGroup.astro +39 -0
  36. package/components/Code.astro +55 -52
  37. package/components/CodeTabs.astro +6 -6
  38. package/components/Collapsible.astro +3 -3
  39. package/components/ColorPicker.astro +3 -2
  40. package/components/Combobox.astro +4 -5
  41. package/components/Command.astro +6 -6
  42. package/components/Container.astro +29 -0
  43. package/components/ContextMenu.astro +7 -13
  44. package/components/CopyButton.astro +55 -0
  45. package/components/CoverImage.astro +19 -9
  46. package/components/DataTable.astro +50 -49
  47. package/components/DatePicker.astro +20 -17
  48. package/components/DateRangePicker.astro +3 -2
  49. package/components/Descriptions.astro +3 -3
  50. package/components/Dialog.astro +8 -14
  51. package/components/Direction.astro +3 -3
  52. package/components/Drawer.astro +7 -13
  53. package/components/DropdownMenu.astro +7 -13
  54. package/components/Empty.astro +6 -6
  55. package/components/ErrorSummary.astro +54 -0
  56. package/components/Eyebrow.astro +2 -2
  57. package/components/Field.astro +7 -6
  58. package/components/FieldError.astro +29 -0
  59. package/components/FileUpload.astro +2 -2
  60. package/components/FloatingBadge.astro +2 -2
  61. package/components/Form.astro +33 -0
  62. package/components/FormattedDate.astro +2 -2
  63. package/components/GradientDivider.astro +2 -2
  64. package/components/Grid.astro +46 -0
  65. package/components/HoverCard.astro +7 -13
  66. package/components/Icon.astro +8 -6
  67. package/components/Image.astro +2 -1
  68. package/components/Input.astro +6 -5
  69. package/components/InputGroup.astro +3 -3
  70. package/components/InputOTP.astro +5 -3
  71. package/components/Item.astro +11 -8
  72. package/components/Kbd.astro +3 -3
  73. package/components/Label.astro +3 -2
  74. package/components/LanguageToggle.astro +2 -2
  75. package/components/LineChart.astro +244 -0
  76. package/components/Link.astro +6 -5
  77. package/components/ListBox.astro +154 -0
  78. package/components/Marker.astro +6 -6
  79. package/components/Mentions.astro +30 -10
  80. package/components/Menubar.astro +7 -13
  81. package/components/Message.astro +5 -5
  82. package/components/MessageScroller.astro +6 -6
  83. package/components/Meter.astro +1 -0
  84. package/components/NativeSelect.astro +4 -5
  85. package/components/NavigationMenu.astro +9 -14
  86. package/components/Note.astro +1 -1
  87. package/components/NumberField.astro +3 -2
  88. package/components/Pagination.astro +3 -3
  89. package/components/Particles.astro +58 -2
  90. package/components/PasswordField.astro +73 -0
  91. package/components/PhoneInput.astro +5 -7
  92. package/components/PieChart.astro +141 -0
  93. package/components/Pill.astro +15 -9
  94. package/components/Popconfirm.astro +8 -3
  95. package/components/Popover.astro +7 -13
  96. package/components/Progress.astro +12 -4
  97. package/components/Prose.astro +2 -2
  98. package/components/QRCode.astro +13 -5
  99. package/components/RadioGroup.astro +3 -3
  100. package/components/Rating.astro +3 -1
  101. package/components/Resizable.astro +8 -7
  102. package/components/RevealGroup.astro +4 -2
  103. package/components/RichTextEditor.astro +3 -2
  104. package/components/Schedule.astro +3 -2
  105. package/components/ScrollArea.astro +6 -6
  106. package/components/ScrollProgress.astro +38 -0
  107. package/components/ScrollReveal.astro +4 -2
  108. package/components/SearchField.astro +3 -2
  109. package/components/Segmented.astro +4 -6
  110. package/components/Select.astro +23 -14
  111. package/components/Separator.astro +5 -5
  112. package/components/Sheet.astro +7 -13
  113. package/components/Sidebar.astro +9 -14
  114. package/components/Skeleton.astro +4 -3
  115. package/components/SkipLink.astro +2 -2
  116. package/components/Slider.astro +3 -2
  117. package/components/Sonner.astro +3 -3
  118. package/components/Sparkline.astro +72 -0
  119. package/components/SpeedDial.astro +3 -3
  120. package/components/Spinner.astro +4 -3
  121. package/components/Stack.astro +46 -0
  122. package/components/Stat.astro +14 -8
  123. package/components/StatDescription.astro +16 -0
  124. package/components/StatIcon.astro +15 -0
  125. package/components/StatLabel.astro +16 -0
  126. package/components/StatTrend.astro +28 -0
  127. package/components/StatValue.astro +16 -0
  128. package/components/Stepper.astro +11 -8
  129. package/components/Switch.astro +3 -2
  130. package/components/Table.astro +7 -6
  131. package/components/Tabs.astro +6 -6
  132. package/components/TagGroup.astro +3 -2
  133. package/components/Textarea.astro +3 -2
  134. package/components/ThemeBuilder.astro +3 -2
  135. package/components/ThemeToggle.astro +5 -3
  136. package/components/TimeField.astro +3 -2
  137. package/components/Timeline.astro +2 -1
  138. package/components/TimelineItem.astro +2 -1
  139. package/components/Toast.astro +10 -16
  140. package/components/Toggle.astro +3 -2
  141. package/components/ToggleGroup.astro +3 -3
  142. package/components/Toolbar.astro +2 -2
  143. package/components/Tooltip.astro +3 -3
  144. package/components/Tour.astro +3 -3
  145. package/components/Transfer.astro +16 -5
  146. package/components/Tree.astro +3 -2
  147. package/components/TreeGrid.astro +3 -2
  148. package/components/TreeSelect.astro +10 -4
  149. package/components/Typography.astro +3 -3
  150. package/components/VirtualList.astro +3 -2
  151. package/components/VisuallyHidden.astro +27 -0
  152. package/components/Watermark.astro +11 -7
  153. package/forms.ts +46 -0
  154. package/index.ts +31 -0
  155. package/package.json +12 -8
  156. package/runtime/UIPrimitives.astro +3764 -3142
  157. package/runtime/controllers/motion.ts +13 -16
  158. package/index.d.ts +0 -126
@@ -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
- 'ui-carousel',
21
- glass && 'ui-carousel--glass',
22
- glass === 'subtle' && 'ui-glass-subtle',
23
- glass === 'strong' && 'ui-glass-strong'
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; nextId?: string | undefined; value: 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 aria-label={column.root ? 'Options' : 'Sub-options'} class="ui-cascader__column" hidden={!column.root} id={column.id} role="listbox">
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
@@ -1,26 +1,37 @@
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
+ caption?: string
7
8
  class?: string | null
8
9
  className?: string
10
+ description?: string
9
11
  glass?: boolean | 'subtle' | 'strong'
12
+ heading?: string
13
+ presentation?: 'bare' | 'default'
14
+ value?: string
10
15
  }
11
16
 
12
17
  const {
18
+ caption,
13
19
  class: classProp = '',
14
20
  className = '',
21
+ description,
15
22
  glass = false,
23
+ heading,
24
+ presentation = 'default',
25
+ value,
16
26
  ...rest
17
27
  } = Astro.props
18
28
 
19
29
  const { classList, passthrough } = resolveLumenAstroProps(rest, [
20
- 'ui-chart',
21
- glass && 'ui-chart--glass',
22
- glass === 'subtle' && 'ui-glass-subtle',
23
- glass === 'strong' && 'ui-glass-strong'
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'
24
35
  ], classProp, className)
25
36
  ---
26
37
 
@@ -28,5 +39,20 @@ const { classList, passthrough } = resolveLumenAstroProps(rest, [
28
39
  class:list={classList}
29
40
  {...passthrough}
30
41
  >
42
+ {
43
+ (heading || description || value || Astro.slots.has('header')) && (
44
+ <header>
45
+ <slot name="header">
46
+ <div class="ui-chart__heading">
47
+ {heading && <h3>{heading}</h3>}
48
+ {description && <p>{description}</p>}
49
+ </div>
50
+ {value && <strong data-ui-chart-value>{value}</strong>}
51
+ </slot>
52
+ <slot name="actions" />
53
+ </header>
54
+ )
55
+ }
31
56
  <slot />
57
+ {caption && <figcaption>{caption}</figcaption>}
32
58
  </figure>
@@ -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>
@@ -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
- <figure
52
- class:list={blockClassList}
53
- data-code-theme={theme}
54
- data-language={language}
55
- data-ui-code
56
- {...passthrough}
57
- >
58
- {shouldShowHeader && (
59
- <figcaption class="ui-code__header">
60
- <span class="ui-code__dots" aria-hidden="true">
61
- <span class="ui-code__dot ui-code__dot--red"></span>
62
- <span class="ui-code__dot ui-code__dot--yellow"></span>
63
- <span class="ui-code__dot ui-code__dot--green"></span>
64
- </span>
65
- <span class="ui-code__meta">
66
- {language && <span class="ui-code__language">{language}</span>}
67
- {label && <span class="ui-code__label">{label}</span>}
68
- </span>
69
- {copy && (
70
- <button
71
- aria-label="Copy code to clipboard"
72
- class="ui-code__copy"
73
- data-ui-code-copy
74
- type="button"
75
- >
76
- <Fragment set:html={renderLumenIconSvg('copy', { className: 'ui-code__copy-icon' })} />
77
- <Fragment set:html={renderLumenIconSvg('check', { className: 'ui-code__check-icon' })} />
78
- </button>
79
- )}
80
- </figcaption>
81
- )}
82
- {highlighted ? (
83
- <slot />
84
- ) : hasCode ? (
85
- <pre><code set:html={renderedCode}></code></pre>
86
- ) : (
87
- <pre><code><slot /></code></pre>
88
- )}
89
- </figure>
90
- ) : (
91
- <code
92
- class:list={inlineClassList}
93
- data-code-theme={theme}
94
- data-language={language}
95
- {...passthrough}
96
- >
97
- {hasCode ? code : <slot />}
98
- </code>
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
- 'ui-collapsible'
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
- typeof option === 'string' ? { label: option, value: option } : option
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
  ---
@@ -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
- 'ui-command',
21
- glass && 'ui-command--glass',
22
- glass === 'subtle' && 'ui-glass-subtle',
23
- glass === 'strong' && 'ui-glass-strong'
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
- 'ui-menu',
27
- resolvedGlass && 'ui-menu--glass',
28
- glass === 'subtle' && 'ui-glass-subtle',
29
- glass === 'strong' && 'ui-glass-strong'
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={resolvedGlass ? 'glass' : 'default'}
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 type { HTMLAttributes } from 'astro/types'
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 = `aspect-16/10 rounded-t-[1.75rem] border-b border-line/45`
68
+ cardWrapperClass = 'aspect-16/10 rounded-t-[1.75rem] border-b border-line/45'
68
69
  } else if (useContainedFrame) {
69
- cardWrapperClass = `${cardAspectClass} rounded-t-[1.75rem] flex items-center justify-center border-b border-line/45 bg-linear-to-br from-surface-muted via-surface to-brand-soft/30 p-4 sm:p-5`
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 = `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`
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 = `mx-auto h-full w-full object-contain motion-safe:group-hover:scale-[1.02]`
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="absolute inset-0 bg-linear-to-t from-canvas/55 via-canvas/10 to-transparent"
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