@leitware/composables 1.3.2 → 1.4.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 (84) hide show
  1. package/README.md +41 -4
  2. package/dist/presets/brutalist.css +6 -2
  3. package/dist/presets/default.css +5 -1
  4. package/dist/presets/signal-pop.css +5 -1
  5. package/dist/styles.css +1 -1
  6. package/dist/tailwind.css +8 -0
  7. package/package.json +2 -1
  8. package/rules/composables.md +9 -7
  9. package/skills/use-composables/references/optional-dependencies.md +1 -1
  10. package/skills/use-composables/references/public-api.md +7 -2
  11. package/skills/use-composables/references/semantic-utilities.md +2 -0
  12. package/src/_internal/ai-elements/chain-of-thought.tsx +1 -1
  13. package/src/_internal/ai-elements/code-block.tsx +1 -1
  14. package/src/_internal/badge.tsx +2 -2
  15. package/src/_internal/bubble.tsx +1 -1
  16. package/src/_internal/button.tsx +1 -1
  17. package/src/_internal/calendar.tsx +1 -1
  18. package/src/_internal/checkbox.tsx +1 -1
  19. package/src/_internal/combobox.tsx +3 -3
  20. package/src/_internal/command.tsx +3 -3
  21. package/src/_internal/dropdown-menu.tsx +2 -2
  22. package/src/_internal/dropzone.tsx +3 -3
  23. package/src/_internal/field.tsx +2 -2
  24. package/src/_internal/grid-overlay.tsx +3 -3
  25. package/src/_internal/input-group.tsx +1 -1
  26. package/src/_internal/input.tsx +1 -1
  27. package/src/_internal/layout-bento.tsx +12 -12
  28. package/src/_internal/layout.tsx +11 -11
  29. package/src/_internal/marker.tsx +1 -1
  30. package/src/_internal/radio-group.tsx +2 -2
  31. package/src/_internal/resizable.tsx +1 -1
  32. package/src/_internal/select.tsx +5 -2
  33. package/src/_internal/sidebar.tsx +2 -2
  34. package/src/_internal/switch.tsx +1 -1
  35. package/src/_internal/tabs.tsx +2 -2
  36. package/src/_internal/textarea.tsx +1 -1
  37. package/src/_internal/tooltip.tsx +1 -1
  38. package/src/index.ts +5 -1
  39. package/src/lib/utils.ts +2 -2
  40. package/src/opinionated/alert.tsx +5 -5
  41. package/src/opinionated/blocks/content.tsx +247 -0
  42. package/src/opinionated/blocks/features.tsx +242 -0
  43. package/src/opinionated/blocks/heroes.tsx +711 -0
  44. package/src/opinionated/blocks/index.ts +4 -0
  45. package/src/opinionated/blocks/shared.tsx +185 -0
  46. package/src/opinionated/button.tsx +3 -1
  47. package/src/opinionated/collapsible.tsx +1 -1
  48. package/src/opinionated/form-calendar-popover.tsx +1 -1
  49. package/src/opinionated/form-checkbox.tsx +1 -1
  50. package/src/opinionated/form-combobox.tsx +1 -1
  51. package/src/opinionated/form-date-of-birth.tsx +1 -1
  52. package/src/opinionated/form-dropzone.tsx +1 -1
  53. package/src/opinionated/form-input-group.tsx +1 -1
  54. package/src/opinionated/form-input.tsx +1 -1
  55. package/src/opinionated/form-multi-combobox.tsx +1 -1
  56. package/src/opinionated/form-multi-dropzone.tsx +1 -1
  57. package/src/opinionated/form-radiogroup.tsx +1 -1
  58. package/src/opinionated/form-select.tsx +1 -1
  59. package/src/opinionated/form-slider.tsx +1 -1
  60. package/src/opinionated/form-switch.tsx +1 -1
  61. package/src/opinionated/form-textarea.tsx +1 -1
  62. package/src/opinionated/theme-injector.tsx +2 -2
  63. package/src/opinionated/token-config-panel/color-editor.tsx +1 -1
  64. package/src/opinionated/token-config-panel/json-import-export.tsx +1 -1
  65. package/src/opinionated/token-config-panel/spacing-editor.tsx +1 -1
  66. package/src/opinionated/token-config-panel/types.ts +1 -1
  67. package/src/opinionated/token-config-panel/typography-editor.tsx +1 -1
  68. package/src/opinionated/window-frame.tsx +57 -0
  69. package/src/styles/composable.css +10 -10
  70. package/src/styles/presets/brutalist.css +6 -2
  71. package/src/styles/presets/default.css +5 -1
  72. package/src/styles/presets/signal-pop.css +5 -1
  73. package/src/styles/presets-data/brutalist.ts +13 -9
  74. package/src/styles/presets-data/default.ts +7 -3
  75. package/src/styles/presets-data/signal-pop.ts +4 -0
  76. package/src/styles/tokens/base.css +1 -1
  77. package/src/styles/tokens/components.css +1 -0
  78. package/src/styles/tokens/palette.css +2 -2
  79. package/src/styles/tokens/registry.ts +15 -1
  80. package/src/styles/tokens/semantic-utilities.css +8 -0
  81. package/src/styles/tokens/semantic.css +6 -2
  82. package/src/styles/tokens/tailwind-color-adapter.css +3 -1
  83. package/src/styles/tokens/tailwind-public-utilities.css +8 -0
  84. package/src/styles/tokens/tailwind-theme.css +7 -7
@@ -40,7 +40,7 @@ function SelectTrigger({
40
40
  className={cn(
41
41
  FOCUS_RING,
42
42
  HOVER_RING,
43
- "border-field data-[placeholder]:text-muted-foreground bg-field/20 dark:bg-field/30 dark:hover:bg-field/50 gap-1.5 rounded-(--input-radius) border px-2 py-1.5 text-xs/relaxed data-[size=default]:h-(--input-height) data-[size=sm]:h-6 *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-3.5 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-disabled *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
43
+ "border-field data-[placeholder]:text-muted-foreground bg-surface-field/20 dark:bg-surface-field/30 dark:hover:bg-surface-field/50 gap-1.5 rounded-(--input-radius) border px-2 py-1.5 text-xs/relaxed data-[size=default]:h-(--input-height) data-[size=sm]:h-6 *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-3.5 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-disabled *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
44
44
  className,
45
45
  )}
46
46
  {...props}
@@ -132,7 +132,10 @@ function SelectSeparator({ className, ...props }: SelectPrimitive.Separator.Prop
132
132
  return (
133
133
  <SelectPrimitive.Separator
134
134
  data-slot="select-separator"
135
- className={cn('bg-stroke/50 -mx-1 my-1 h-px pointer-events-none', className)}
135
+ className={cn(
136
+ 'bg-stroke/50 -mx-1 my-1 h-(--border-width-base) pointer-events-none',
137
+ className,
138
+ )}
136
139
  {...props}
137
140
  />
138
141
  )
@@ -272,7 +272,7 @@ function SidebarRail({ className, ...props }: React.ComponentProps<'button'>) {
272
272
  onClick={toggleSidebar}
273
273
  title="Toggle Sidebar"
274
274
  className={cn(
275
- 'hover:after:bg-sidebar-border absolute inset-y-0 z-sticky hidden w-4 -translate-x-1/2 transition-[opacity,box-shadow] ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex',
275
+ 'hover:after:bg-sidebar-border absolute inset-y-0 z-sticky hidden w-4 -translate-x-1/2 transition-[opacity,box-shadow] ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-(--border-width-base) sm:flex',
276
276
  'in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize',
277
277
  '[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize',
278
278
  'hover:group-data-[collapsible=offExamples]:bg-sidebar group-data-[collapsible=offExamples]:translate-x-0 group-data-[collapsible=offExamples]:after:left-full',
@@ -455,7 +455,7 @@ const sidebarMenuButtonVariants = cva(
455
455
  variant: {
456
456
  default: 'hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
457
457
  outline:
458
- 'bg-page hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]',
458
+ 'bg-page hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_var(--border-width-base)_var(--sidebar-border)] hover:shadow-[0_0_0_var(--border-width-base)_var(--sidebar-accent)]',
459
459
  },
460
460
  size: {
461
461
  default: 'h-8 text-xs',
@@ -16,7 +16,7 @@ function Switch({
16
16
  className={cn(
17
17
  FOCUS_RING,
18
18
  HOVER_RING,
19
- 'data-checked:bg-primary data-unchecked:bg-field dark:data-unchecked:bg-field/80 shrink-0 rounded-[var(--radius)] p-0.5 data-[size=default]:h-4 data-[size=default]:w-7 data-[size=sm]:h-3.5 data-[size=sm]:w-6 peer group/switch relative inline-flex items-center transition-[opacity,box-shadow] outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-disabled',
19
+ 'data-checked:bg-primary data-unchecked:bg-surface-field dark:data-unchecked:bg-surface-field/80 shrink-0 rounded-[var(--radius)] p-0.5 data-[size=default]:h-4 data-[size=default]:w-7 data-[size=sm]:h-3.5 data-[size=sm]:w-6 peer group/switch relative inline-flex items-center transition-[opacity,box-shadow] outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-disabled',
20
20
  className,
21
21
  )}
22
22
  {...props}
@@ -50,9 +50,9 @@ function TabsTrigger({ className, ...props }: TabsPrimitive.Tab.Props) {
50
50
  data-slot="tabs-trigger"
51
51
  className={cn(
52
52
  FOCUS_RING,
53
- "gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-xs font-medium group-data-vertical/tabs:py-[calc(--spacing(1.25))] [&_svg:not([class*='size-'])]:size-3.5 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap transition-[opacity,box-shadow] group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-disabled [&_svg]:pointer-events-none [&_svg]:shrink-0",
53
+ "gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-xs font-medium group-data-vertical/tabs:py-[calc(--spacing(1.25))] [&_svg:not([class*='size-'])]:size-3.5 focus-visible:outline-ring text-muted hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap transition-[opacity,box-shadow] group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-disabled [&_svg]:pointer-events-none [&_svg]:shrink-0",
54
54
  'group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent',
55
- 'data-active:bg-page dark:data-active:text-foreground dark:data-active:border-field dark:data-active:bg-field/30 data-active:text-foreground',
55
+ 'data-active:bg-page dark:data-active:text-foreground dark:data-active:border-field dark:data-active:bg-surface-field/30 data-active:text-foreground',
56
56
  'after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100',
57
57
  className,
58
58
  )}
@@ -9,7 +9,7 @@ function Textarea({ className, ...props }: React.ComponentProps<'textarea'>) {
9
9
  className={cn(
10
10
  FOCUS_RING,
11
11
  HOVER_RING,
12
- 'border-field bg-field/20 dark:bg-field/30 resize-none rounded-(--input-radius) border px-2 py-2 text-sm md:text-xs/relaxed placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-disabled',
12
+ 'border-field bg-surface-field/20 dark:bg-surface-field/30 resize-none rounded-(--input-radius) border px-2 py-2 text-sm md:text-xs/relaxed placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-disabled',
13
13
  className,
14
14
  )}
15
15
  {...props}
@@ -40,7 +40,7 @@ function TooltipContent({
40
40
  <TooltipPrimitive.Popup
41
41
  data-slot="tooltip-content"
42
42
  className={cn(
43
- 'data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rounded-md px-3 py-1.5 text-xs **:data-[slot=kbd]:rounded-md bg-foreground text-background z-tooltip w-fit max-w-xs origin-(--transform-origin)',
43
+ 'data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rounded-md px-3 py-1.5 text-xs **:data-[slot=kbd]:rounded-md bg-surface-inverse text-inverse z-tooltip w-fit max-w-xs origin-(--transform-origin)',
44
44
  className,
45
45
  )}
46
46
  {...props}
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  // ============================================================================
2
- // @leitware/composables — barrel exports
2
+ // @leitware/composables - barrel exports
3
3
  // ============================================================================
4
4
 
5
5
  // ── Utilities ───────────────────────────────────────────────────────────────
@@ -23,6 +23,10 @@ export {
23
23
  // ── Opinionated components ──────────────────────────────────────────────────
24
24
  // These are the recommended, higher-level wrappers that most users should use.
25
25
 
26
+ // ── Page blocks ─────────────────────────────────────────────────────────────
27
+ export * from './opinionated/blocks'
28
+ export { WindowFrame, type WindowFrameProps } from './opinionated/window-frame'
29
+
26
30
  export {
27
31
  Accordion,
28
32
  AccordionContent,
package/src/lib/utils.ts CHANGED
@@ -27,11 +27,11 @@ export const HOVER_RING =
27
27
  export const GROUP_FOCUS_RING =
28
28
  'has-[:focus-visible]:border-[var(--focus-ring-color)] has-[:focus-visible]:ring-[color:var(--focus-ring-color)]/30 has-[:focus-visible]:ring-[length:var(--focus-ring-width)] has-aria-invalid:ring-stroke-critical/20 dark:has-aria-invalid:ring-stroke-critical/40 has-aria-invalid:border-stroke-critical dark:has-aria-invalid:border-stroke-critical/50 has-aria-invalid:ring-[length:var(--focus-ring-width)]'
29
29
 
30
- /** Destructive-variant focus override – layer on top of FOCUS_RING. */
30
+ /** Destructive-variant focus override layered on top of FOCUS_RING. */
31
31
  export const FOCUS_RING_DESTRUCTIVE =
32
32
  'focus-visible:ring-stroke-critical/20 dark:focus-visible:ring-stroke-critical/40 focus-visible:border-stroke-critical/40'
33
33
 
34
- /** Disabled state opacity — single source of truth for all disabled elements. */
34
+ /** Disabled state opacity - single source of truth for all disabled elements. */
35
35
  export const DISABLED_OPACITY = 'disabled:opacity-disabled'
36
36
 
37
37
  /**
@@ -35,11 +35,11 @@ export type AlertVariant = NonNullable<VariantProps<typeof alertVariants>['varia
35
35
  export interface AlertProps extends Omit<React.ComponentProps<typeof AlertPrimitive>, 'title'> {
36
36
  /**
37
37
  * Semantic type that controls the icon and colour variant.
38
- * - `default` — no icon, neutral styling
39
- * - `notice` — info icon (ℹ), neutral styling
40
- * - `positive` — check icon, green styling
41
- * - `warning` — triangle icon, amber styling
42
- * - `negative` — alert triangle icon, red/destructive styling
38
+ * - `default` - no icon, neutral styling
39
+ * - `notice` - info icon (ℹ), neutral styling
40
+ * - `positive` - check icon, green styling
41
+ * - `warning` - triangle icon, amber styling
42
+ * - `negative` - alert triangle icon, red/destructive styling
43
43
  * @default 'default'
44
44
  */
45
45
  type?: AlertType
@@ -0,0 +1,247 @@
1
+ import {
2
+ Code2Icon,
3
+ LayoutDashboardIcon,
4
+ Layers3Icon,
5
+ PaletteIcon,
6
+ SparklesIcon,
7
+ UsersIcon,
8
+ ZapIcon,
9
+ type LucideIcon,
10
+ } from 'lucide-react'
11
+ import { Card } from '../card'
12
+ import { cn } from '../../lib/utils'
13
+ import {
14
+ BlockAction,
15
+ BlockDashboard,
16
+ BlockHeading,
17
+ BlockImage,
18
+ BlockSection,
19
+ type BlockBaseProps,
20
+ type BlockCTA,
21
+ type BlockMedia,
22
+ } from './shared'
23
+
24
+ type IconName = 'Palette' | 'Layers' | 'Code' | 'Users' | 'Zap' | 'LayoutDashboard' | 'Sparkles'
25
+ const icons: Record<IconName, LucideIcon> = {
26
+ Palette: PaletteIcon,
27
+ Layers: Layers3Icon,
28
+ Code: Code2Icon,
29
+ Users: UsersIcon,
30
+ Zap: ZapIcon,
31
+ LayoutDashboard: LayoutDashboardIcon,
32
+ Sparkles: SparklesIcon,
33
+ }
34
+
35
+ function ItemIcon({ name }: { name?: IconName }) {
36
+ const Icon = name ? icons[name] : SparklesIcon
37
+ return <Icon aria-hidden="true" className="size-5 text-icon-brand" />
38
+ }
39
+
40
+ type ContentHead = BlockBaseProps & { title: string; description: string }
41
+ type ContentItem = { title: string; description: string; media: BlockMedia; icon?: IconName }
42
+
43
+ export interface Content02Props extends ContentHead {
44
+ items: ContentItem[]
45
+ }
46
+ export function Content02({
47
+ title,
48
+ description,
49
+ items,
50
+ variant,
51
+ animation,
52
+ className,
53
+ }: Content02Props) {
54
+ return (
55
+ <BlockSection variant={variant} animation={animation} className={className}>
56
+ <BlockHeading title={title} description={description} />
57
+ <div className="mt-12 grid gap-8 md:grid-cols-3">
58
+ {items.map((item) => (
59
+ <article key={item.title}>
60
+ <div className="aspect-[4/3] overflow-hidden rounded-xl bg-surface-accent">
61
+ <BlockImage media={item.media} />
62
+ </div>
63
+ <div className="mt-5 flex items-start gap-3">
64
+ <span className="rounded-lg bg-surface-brand p-2">
65
+ <ItemIcon name={item.icon} />
66
+ </span>
67
+ <div>
68
+ <h3 className="text-lg font-semibold">{item.title}</h3>
69
+ <p className="mt-2 text-sm leading-relaxed text-[var(--text-secondary)]">
70
+ {item.description}
71
+ </p>
72
+ </div>
73
+ </div>
74
+ </article>
75
+ ))}
76
+ </div>
77
+ </BlockSection>
78
+ )
79
+ }
80
+
81
+ export interface Content04Props extends ContentHead {
82
+ items: ContentItem[]
83
+ }
84
+ export function Content04({
85
+ title,
86
+ description,
87
+ items,
88
+ variant,
89
+ animation,
90
+ className,
91
+ }: Content04Props) {
92
+ return (
93
+ <BlockSection variant={variant} animation={animation} className={className}>
94
+ <BlockHeading title={title} description={description} />
95
+ <div className="mt-12 grid gap-8 md:grid-cols-2">
96
+ {items.map((item) => (
97
+ <article key={item.title} className="border-t border-stroke-default pt-5">
98
+ <h3 className="text-xl font-semibold">{item.title}</h3>
99
+ <p className="mt-3 max-w-lg text-sm leading-relaxed text-[var(--text-secondary)]">
100
+ {item.description}
101
+ </p>
102
+ <div className="mt-7 aspect-[4/3] overflow-hidden rounded-xl bg-surface-accent">
103
+ <BlockImage media={item.media} />
104
+ </div>
105
+ </article>
106
+ ))}
107
+ </div>
108
+ </BlockSection>
109
+ )
110
+ }
111
+
112
+ export interface Content06Props extends ContentHead {
113
+ media: BlockMedia
114
+ cta?: BlockCTA
115
+ }
116
+ export function Content06({
117
+ title,
118
+ description,
119
+ media,
120
+ cta,
121
+ variant,
122
+ animation,
123
+ className,
124
+ }: Content06Props) {
125
+ return (
126
+ <BlockSection variant={variant} animation={animation} className={className}>
127
+ <div className="grid items-center gap-10 md:grid-cols-2">
128
+ <div>
129
+ <BlockHeading title={title} description={description} />
130
+ <BlockAction action={cta} className="mt-8" />
131
+ </div>
132
+ <div className="aspect-[4/3] overflow-hidden rounded-xl bg-surface-accent">
133
+ <BlockImage media={media} />
134
+ </div>
135
+ </div>
136
+ </BlockSection>
137
+ )
138
+ }
139
+
140
+ export interface Content07Props extends ContentHead {
141
+ items: { title: string; content: string; media: BlockMedia; cta?: BlockCTA }[]
142
+ }
143
+ export function Content07({
144
+ title,
145
+ description,
146
+ items,
147
+ variant,
148
+ animation,
149
+ className,
150
+ }: Content07Props) {
151
+ return (
152
+ <BlockSection variant={variant} animation={animation} className={className}>
153
+ <BlockHeading title={title} description={description} />
154
+ <div className="mt-12 grid gap-10 md:grid-cols-2">
155
+ {items.map((item) => (
156
+ <article key={item.title}>
157
+ <div className="aspect-[4/3] overflow-hidden rounded-xl bg-surface-accent">
158
+ <BlockImage media={item.media} />
159
+ </div>
160
+ <h3 className="mt-6 text-xl font-semibold">{item.title}</h3>
161
+ <p className="mt-3 max-w-lg text-sm leading-relaxed text-[var(--text-secondary)]">
162
+ {item.content}
163
+ </p>
164
+ <BlockAction action={item.cta} className="mt-6" arrow />
165
+ </article>
166
+ ))}
167
+ </div>
168
+ </BlockSection>
169
+ )
170
+ }
171
+
172
+ export interface Content09Props extends ContentHead {
173
+ items: { title: string; description: string; icon?: IconName }[]
174
+ }
175
+ export function Content09({
176
+ title,
177
+ description,
178
+ items,
179
+ variant,
180
+ animation,
181
+ className,
182
+ }: Content09Props) {
183
+ return (
184
+ <BlockSection variant={variant} animation={animation} className={className}>
185
+ <BlockHeading title={title} description={description} />
186
+ <div className="mt-12 grid gap-4 md:grid-cols-2">
187
+ {items.map((item) => (
188
+ <Card key={item.title} className="min-h-48 border-stroke-default bg-surface-default">
189
+ <div className="flex items-start gap-4">
190
+ <span className="rounded-lg bg-surface-brand p-3">
191
+ <ItemIcon name={item.icon} />
192
+ </span>
193
+ <div>
194
+ <h3 className="text-lg font-semibold">{item.title}</h3>
195
+ <p className="mt-3 text-sm leading-relaxed text-[var(--text-secondary)]">
196
+ {item.description}
197
+ </p>
198
+ </div>
199
+ </div>
200
+ </Card>
201
+ ))}
202
+ </div>
203
+ </BlockSection>
204
+ )
205
+ }
206
+
207
+ export interface Content11Props extends ContentHead {
208
+ feature1: { icon?: IconName; title: string; description: string }
209
+ feature2: { icon?: IconName; title: string; description: string }
210
+ }
211
+ export function Content11({
212
+ title,
213
+ description,
214
+ feature1,
215
+ feature2,
216
+ variant,
217
+ animation,
218
+ className,
219
+ }: Content11Props) {
220
+ return (
221
+ <BlockSection variant={variant} animation={animation} className={className}>
222
+ <div className="grid items-center gap-12 lg:grid-cols-2">
223
+ <div>
224
+ <BlockHeading title={title} description={description} />
225
+ <div className="mt-10 space-y-8">
226
+ {[feature1, feature2].map((feature) => (
227
+ <div key={feature.title} className="flex gap-4 border-t border-stroke-default pt-5">
228
+ <span className="rounded-lg bg-surface-brand p-3">
229
+ <ItemIcon name={feature.icon} />
230
+ </span>
231
+ <div>
232
+ <h3 className="font-semibold">{feature.title}</h3>
233
+ <p className="mt-2 text-sm leading-relaxed text-[var(--text-secondary)]">
234
+ {feature.description}
235
+ </p>
236
+ </div>
237
+ </div>
238
+ ))}
239
+ </div>
240
+ </div>
241
+ <div className={cn('rounded-2xl bg-surface-accent p-5 md:p-8')}>
242
+ <BlockDashboard />
243
+ </div>
244
+ </div>
245
+ </BlockSection>
246
+ )
247
+ }
@@ -0,0 +1,242 @@
1
+ import { useState } from 'react'
2
+ import { ArrowRightIcon } from 'lucide-react'
3
+ import { Avatar } from '../avatar'
4
+ import { BentoCell, BentoGrid } from '../layout-bento'
5
+ import { cn } from '../../lib/utils'
6
+ import {
7
+ BlockAction,
8
+ BlockHeading,
9
+ BlockImage,
10
+ BlockSection,
11
+ type BlockBaseProps,
12
+ type BlockCTA,
13
+ type BlockMedia,
14
+ } from './shared'
15
+
16
+ type FeatureItem = { id: string; title: string; description: string; media: BlockMedia }
17
+
18
+ export interface Feature01Props extends BlockBaseProps {
19
+ items: FeatureItem[]
20
+ }
21
+ export function Feature01({ items, variant, animation, className }: Feature01Props) {
22
+ const [active, setActive] = useState(0)
23
+ const current = items[active]
24
+ return (
25
+ <BlockSection variant={variant} animation={animation} className={className}>
26
+ <div className="grid gap-10 md:grid-cols-2">
27
+ <div className="divide-y divide-[var(--border-default)] border-y border-stroke-default">
28
+ {items.map((item, index) => (
29
+ <button
30
+ key={item.id}
31
+ type="button"
32
+ onClick={() => setActive(index)}
33
+ aria-pressed={active === index}
34
+ className={cn(
35
+ 'group flex w-full items-start gap-5 py-6 text-left transition-colors',
36
+ active === index ? 'text-default' : 'text-[var(--text-muted)] hover:text-default',
37
+ )}
38
+ >
39
+ <span className="pt-1 text-xs tabular-nums">{item.id}</span>
40
+ <span className="flex-1">
41
+ <span className="block font-heading text-2xl">{item.title}</span>
42
+ {active === index && (
43
+ <span className="mt-3 block max-w-md text-sm leading-relaxed text-[var(--text-secondary)]">
44
+ {item.description}
45
+ </span>
46
+ )}
47
+ </span>
48
+ <ArrowRightIcon className="mt-1 size-4" />
49
+ </button>
50
+ ))}
51
+ </div>
52
+ <div className="aspect-[4/3] overflow-hidden rounded-xl bg-surface-accent">
53
+ {current && <BlockImage media={current.media} />}
54
+ </div>
55
+ </div>
56
+ </BlockSection>
57
+ )
58
+ }
59
+
60
+ export interface Feature02Props extends BlockBaseProps {
61
+ title: string
62
+ description: string
63
+ image: string
64
+ imageAlt: string
65
+ steps: { number: string; title: string; description: string }[]
66
+ }
67
+ export function Feature02({
68
+ title,
69
+ description,
70
+ image,
71
+ imageAlt,
72
+ steps,
73
+ animation,
74
+ className,
75
+ }: Feature02Props) {
76
+ const midpoint = Math.ceil(steps.length / 2)
77
+ const Step = ({
78
+ number,
79
+ title: stepTitle,
80
+ description: stepDescription,
81
+ }: (typeof steps)[number]) => (
82
+ <div className="border-t border-stroke-default pt-5">
83
+ <span className="text-xs text-brand">{number}</span>
84
+ <h3 className="mt-4 text-xl font-semibold">{stepTitle}</h3>
85
+ <p className="mt-3 text-sm leading-relaxed text-[var(--text-secondary)]">{stepDescription}</p>
86
+ </div>
87
+ )
88
+ return (
89
+ <BlockSection animation={animation} className={className}>
90
+ <div className="grid gap-8 md:grid-cols-2">
91
+ <BlockHeading title={title} />
92
+ <p className="self-end text-[var(--text-secondary)]">{description}</p>
93
+ </div>
94
+ <div className="mt-14 grid gap-8 lg:grid-cols-[1fr_1.2fr_1fr]">
95
+ <div className="flex flex-col justify-around gap-8">
96
+ {steps.slice(0, midpoint).map((step) => (
97
+ <Step key={step.number} {...step} />
98
+ ))}
99
+ </div>
100
+ <div className="min-h-[34rem] overflow-hidden rounded-xl bg-surface-accent">
101
+ <BlockImage media={{ src: image, alt: imageAlt }} />
102
+ </div>
103
+ <div className="flex flex-col justify-around gap-8">
104
+ {steps.slice(midpoint).map((step) => (
105
+ <Step key={step.number} {...step} />
106
+ ))}
107
+ </div>
108
+ </div>
109
+ </BlockSection>
110
+ )
111
+ }
112
+
113
+ export interface Feature03Props extends BlockBaseProps {
114
+ title: string
115
+ description: string
116
+ items: FeatureItem[]
117
+ }
118
+ export function Feature03({
119
+ title,
120
+ description,
121
+ items,
122
+ variant,
123
+ animation,
124
+ className,
125
+ }: Feature03Props) {
126
+ return (
127
+ <BlockSection variant={variant} animation={animation} className={className}>
128
+ <div className="grid gap-12 lg:grid-cols-2">
129
+ <div className="self-start lg:sticky lg:top-12">
130
+ <BlockHeading title={title} description={description} />
131
+ </div>
132
+ <div className="space-y-14">
133
+ {items.map((item) => (
134
+ <article key={item.id}>
135
+ <div className="aspect-[4/3] overflow-hidden rounded-xl bg-surface-accent">
136
+ <BlockImage media={item.media} />
137
+ </div>
138
+ <div className="mt-5 flex gap-5 border-t border-stroke-default pt-5">
139
+ <span className="text-xs text-[var(--text-muted)]">{item.id}</span>
140
+ <div>
141
+ <h3 className="text-xl font-semibold">{item.title}</h3>
142
+ <p className="mt-3 text-sm leading-relaxed text-[var(--text-secondary)]">
143
+ {item.description}
144
+ </p>
145
+ </div>
146
+ </div>
147
+ </article>
148
+ ))}
149
+ </div>
150
+ </div>
151
+ </BlockSection>
152
+ )
153
+ }
154
+
155
+ export interface Cta01Props extends BlockBaseProps {
156
+ title: string
157
+ description: string
158
+ cta?: BlockCTA
159
+ }
160
+ export function Cta01({ title, description, cta, className }: Cta01Props) {
161
+ return (
162
+ <BlockSection className={cn('text-center', className)}>
163
+ <BlockHeading title={title} description={description} centered className="[&_p]:mx-auto" />
164
+ <BlockAction action={cta} className="mt-8" />
165
+ </BlockSection>
166
+ )
167
+ }
168
+
169
+ type BentoMedia = { src: string; title: string }
170
+ type BentoItem = { title: string; description: string; media: BentoMedia }
171
+ export interface BentoGrids01Props extends BlockBaseProps {
172
+ primary: BentoItem & { cta?: BlockCTA }
173
+ items: BentoItem[]
174
+ }
175
+ export function BentoGrids01({ primary, items, className }: BentoGrids01Props) {
176
+ return (
177
+ <BlockSection className={className}>
178
+ <BentoGrid cols={3} className="gap-3 bg-transparent p-0">
179
+ <BentoCell
180
+ colSpan={2}
181
+ rowSpan={2}
182
+ className="relative flex min-h-[32rem] flex-col justify-end overflow-hidden p-0"
183
+ >
184
+ <BlockImage
185
+ media={{ src: primary.media.src, alt: primary.media.title }}
186
+ className="absolute inset-0"
187
+ />
188
+ <div className="absolute inset-0 bg-gradient-to-t from-black/85 via-black/20 to-transparent" />
189
+ <div className="relative p-8 text-white">
190
+ <h2 className="font-heading text-3xl">{primary.title}</h2>
191
+ <p className="mt-3 max-w-md text-sm">{primary.description}</p>
192
+ <BlockAction action={primary.cta} className="mt-6" />
193
+ </div>
194
+ </BentoCell>
195
+ {items.map((item) => (
196
+ <BentoCell
197
+ key={item.title}
198
+ className="relative flex min-h-56 flex-col justify-end overflow-hidden p-0"
199
+ >
200
+ <BlockImage
201
+ media={{ src: item.media.src, alt: item.media.title }}
202
+ className="absolute inset-0"
203
+ />
204
+ <div className="absolute inset-0 bg-gradient-to-t from-black/80 to-transparent" />
205
+ <div className="relative p-5 text-white">
206
+ <h3 className="text-lg font-semibold">{item.title}</h3>
207
+ <p className="mt-2 text-xs">{item.description}</p>
208
+ </div>
209
+ </BentoCell>
210
+ ))}
211
+ </BentoGrid>
212
+ </BlockSection>
213
+ )
214
+ }
215
+
216
+ export interface Testimonials01Props extends BlockBaseProps {
217
+ quote: string
218
+ author: { name: string; role: string; avatar: { src?: string; alt?: string; fallback: string } }
219
+ }
220
+ export function Testimonials01({ quote, author, className }: Testimonials01Props) {
221
+ return (
222
+ <BlockSection className={cn('text-center', className)}>
223
+ <figure className="mx-auto max-w-3xl py-12">
224
+ <blockquote className="font-heading text-2xl leading-snug tracking-tight md:text-4xl">
225
+ “{quote}”
226
+ </blockquote>
227
+ <figcaption className="mt-9 flex items-center justify-center gap-4 text-left">
228
+ <Avatar
229
+ src={author.avatar.src}
230
+ alt={author.avatar.alt ?? author.name}
231
+ fallback={author.avatar.fallback}
232
+ size="lg"
233
+ />
234
+ <span>
235
+ <span className="block text-sm font-semibold">{author.name}</span>
236
+ <span className="mt-1 block text-xs text-[var(--text-muted)]">{author.role}</span>
237
+ </span>
238
+ </figcaption>
239
+ </figure>
240
+ </BlockSection>
241
+ )
242
+ }