@enablo/swirlcn-ui 0.5.0 → 0.6.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/dist/server.js CHANGED
@@ -1,4 +1,4 @@
1
- export { gap, gapX, gapY, padding, spacingScale } from './chunk-3DJWDNQL.js';
1
+ export { gap, gapX, gapY, padding, spacingScale } from './chunk-HRH6AKCA.js';
2
2
  export { cn, focusRing, focusRingInset, resolveAlias } from './chunk-KZESIYUN.js';
3
3
  import { createElement } from 'react';
4
4
  import { jsx } from 'react/jsx-runtime';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enablo/swirlcn-ui",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "A shadcn/ui-style React component library themed with the Flip Swirl design system.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -54,8 +54,8 @@
54
54
  "react": "^18.0.0 || ^19.0.0",
55
55
  "react-dom": "^18.0.0 || ^19.0.0",
56
56
  "tailwindcss": "^4.0.0",
57
- "@enablo/swirlcn-icons": "^0.5.0",
58
- "@enablo/swirlcn-tokens": "^0.5.0"
57
+ "@enablo/swirlcn-icons": "^0.6.0",
58
+ "@enablo/swirlcn-tokens": "^0.6.0"
59
59
  },
60
60
  "peerDependenciesMeta": {
61
61
  "@getflip/bridge": {
@@ -74,8 +74,8 @@
74
74
  "tsup": "^8.5.1",
75
75
  "typescript": "5.9.3",
76
76
  "typescript-eslint": "8.71.0",
77
- "@enablo/swirlcn-icons": "0.5.0",
78
- "@enablo/swirlcn-tokens": "0.5.0"
77
+ "@enablo/swirlcn-icons": "0.6.0",
78
+ "@enablo/swirlcn-tokens": "0.6.0"
79
79
  },
80
80
  "scripts": {
81
81
  "build": "tsup && node scripts/postbuild.mjs",
@@ -0,0 +1,145 @@
1
+ import * as React from "react";
2
+ import { cn } from "../lib/utils";
3
+ import { Glyph } from "../lib/glyphs";
4
+ import { spaceVar, type SwirlSpacing } from "../lib/spacing";
5
+ import { Button } from "./button";
6
+
7
+ export interface AppBarProps extends Omit<React.ComponentProps<"div">, "children"> {
8
+ /** The bar's title, such as a `Heading`. Swirl's `heading` slot. */
9
+ heading?: React.ReactNode;
10
+ /** Show the heading. Without one, the centre controls take its place at every width. */
11
+ showHeading?: boolean;
12
+ /** Controls in the middle of the bar, such as a search field. Shown from 992px while there is a heading. */
13
+ centerControls?: React.ReactNode;
14
+ /** A call to action before the heading, such as a primary button. */
15
+ cta?: React.ReactNode;
16
+ /** Controls at the end of the bar. */
17
+ rightControls?: React.ReactNode;
18
+ showBackButton?: boolean;
19
+ backButtonLabel?: string;
20
+ onBackButtonClick?: React.MouseEventHandler<HTMLButtonElement>;
21
+ showCloseButton?: boolean;
22
+ closeButtonLabel?: string;
23
+ /** Replaces the close button's cross. */
24
+ closeButtonIcon?: React.ReactNode;
25
+ onCloseButtonClick?: React.MouseEventHandler<HTMLButtonElement>;
26
+ /** Previous and next buttons, for stepping through items such as a list's rows. */
27
+ showStepperControls?: boolean;
28
+ stepUpButtonLabel?: string;
29
+ stepDownButtonLabel?: string;
30
+ onStepUpButtonClick?: React.MouseEventHandler<HTMLButtonElement>;
31
+ onStepDownButtonClick?: React.MouseEventHandler<HTMLButtonElement>;
32
+ paddingInlineStart?: SwirlSpacing;
33
+ paddingInlineEnd?: SwirlSpacing;
34
+ }
35
+
36
+ /**
37
+ * Swirl's app bar: the bar across the top of a view, with back, close and
38
+ * stepper buttons, a heading, centre controls and controls at the end. It
39
+ * scrolls sideways rather than wrapping when its content is too wide.
40
+ *
41
+ * For an app embedded in Flip, `FlipAppHeader` draws Flip's own header instead.
42
+ */
43
+ export function AppBar({
44
+ heading,
45
+ showHeading = true,
46
+ centerControls,
47
+ cta,
48
+ rightControls,
49
+ showBackButton = false,
50
+ backButtonLabel = "Go back",
51
+ onBackButtonClick,
52
+ showCloseButton = false,
53
+ closeButtonLabel = "Close",
54
+ closeButtonIcon,
55
+ onCloseButtonClick,
56
+ showStepperControls = false,
57
+ stepUpButtonLabel = "Previous item",
58
+ stepDownButtonLabel = "Next item",
59
+ onStepUpButtonClick,
60
+ onStepDownButtonClick,
61
+ paddingInlineStart = "16",
62
+ paddingInlineEnd = "16",
63
+ className,
64
+ style,
65
+ ...props
66
+ }: AppBarProps) {
67
+ const hasHeading = heading !== undefined && heading !== null && showHeading;
68
+ const showNavigation = showBackButton || showCloseButton;
69
+
70
+ return (
71
+ <div
72
+ className={cn("flex min-h-14 w-full items-center gap-4 overflow-x-auto", className)}
73
+ style={{
74
+ paddingInlineStart: spaceVar(paddingInlineStart),
75
+ paddingInlineEnd: spaceVar(paddingInlineEnd),
76
+ ...style,
77
+ }}
78
+ {...props}
79
+ >
80
+ {(showNavigation || showStepperControls) && (
81
+ <div className="flex min-w-0 shrink-0 items-center gap-4">
82
+ {showNavigation && (
83
+ <div className="shrink-0">
84
+ {showBackButton && (
85
+ <Button
86
+ hideLabel
87
+ icon={<Glyph name="arrowBack" />}
88
+ label={backButtonLabel}
89
+ onClick={onBackButtonClick}
90
+ />
91
+ )}
92
+ {showCloseButton && (
93
+ <Button
94
+ hideLabel
95
+ icon={closeButtonIcon ?? <Glyph name="close" />}
96
+ label={closeButtonLabel}
97
+ onClick={onCloseButtonClick}
98
+ />
99
+ )}
100
+ </div>
101
+ )}
102
+ {showStepperControls && (
103
+ <div
104
+ className={cn(
105
+ "relative flex shrink-0 gap-1",
106
+ // A short rule between the stepper and the buttons before it.
107
+ "not-first:pl-4 not-first:after:absolute not-first:after:top-1/2 not-first:after:left-0",
108
+ "not-first:after:h-5 not-first:after:w-px not-first:after:-translate-y-1/2 not-first:after:bg-border",
109
+ )}
110
+ >
111
+ <Button
112
+ hideLabel
113
+ icon={<Glyph name="arrowUpward" />}
114
+ label={stepUpButtonLabel}
115
+ onClick={onStepUpButtonClick}
116
+ />
117
+ <Button
118
+ hideLabel
119
+ icon={<Glyph name="arrowDownward" />}
120
+ label={stepDownButtonLabel}
121
+ onClick={onStepDownButtonClick}
122
+ />
123
+ </div>
124
+ )}
125
+ </div>
126
+ )}
127
+ {cta !== undefined && cta !== null && <div>{cta}</div>}
128
+ {hasHeading && (
129
+ <div className="flex min-w-40 grow items-center min-[62rem]:min-w-0 min-[62rem]:grow-0">{heading}</div>
130
+ )}
131
+ {/* Always drawn: with nothing in it, it still pushes the end controls to the end. */}
132
+ <div
133
+ className={cn(
134
+ "grow items-center justify-center",
135
+ hasHeading ? "hidden min-[62rem]:flex" : "flex",
136
+ )}
137
+ >
138
+ {centerControls}
139
+ </div>
140
+ {rightControls !== undefined && rightControls !== null && (
141
+ <div className="flex min-w-0 shrink-0 items-center justify-end">{rightControls}</div>
142
+ )}
143
+ </div>
144
+ );
145
+ }
@@ -1,7 +1,7 @@
1
1
  import { cva, type VariantProps } from "class-variance-authority";
2
2
  import { cn } from "../lib/utils";
3
3
  import { focusRing } from "../lib/focus";
4
- import { padding as paddingClass, type SwirlSpacing } from "../lib/spacing";
4
+ import { padding as paddingClass, spaceVar, type SwirlSpacing } from "../lib/spacing";
5
5
 
6
6
  // Swirl clips a card to its corners; `overflow` can lift that.
7
7
  const cardVariants = cva("relative flex flex-col text-foreground transition-colors duration-200", {
@@ -52,6 +52,13 @@ export interface CardProps
52
52
  as?: React.ElementType;
53
53
  /** Uniform padding, in Swirl's px spacing steps. */
54
54
  padding?: SwirlSpacing;
55
+ /** One side's padding, overriding `padding` on that side. */
56
+ paddingBlockStart?: SwirlSpacing;
57
+ paddingBlockEnd?: SwirlSpacing;
58
+ paddingInlineStart?: SwirlSpacing;
59
+ paddingInlineEnd?: SwirlSpacing;
60
+ /** CSS min height, such as "10rem". */
61
+ minHeight?: string;
55
62
  /** Drop the border. Swirl calls this `isBorderless`. */
56
63
  borderless?: boolean;
57
64
  /** Add a shadow. Pair with `elevationLevel` to choose which. */
@@ -88,6 +95,11 @@ export function Card({
88
95
  elevated = false,
89
96
  elevationLevel = 3,
90
97
  padding,
98
+ paddingBlockStart,
99
+ paddingBlockEnd,
100
+ paddingInlineStart,
101
+ paddingInlineEnd,
102
+ minHeight,
91
103
  borderless = false,
92
104
  interactive = false,
93
105
  highlighted,
@@ -98,6 +110,7 @@ export function Card({
98
110
  floatingControls,
99
111
  flashing = false,
100
112
  children,
113
+ style,
101
114
  ...props
102
115
  }: CardProps) {
103
116
  const isLink = href !== undefined;
@@ -106,6 +119,14 @@ export function Card({
106
119
  // With an image, the content sits in Swirl's padded body under it.
107
120
  const body = image !== undefined;
108
121
 
122
+ // Per side, as Swirl's own padding props are: inline, since any side can take any step.
123
+ const sides = {
124
+ paddingBlockStart: spaceVar(paddingBlockStart),
125
+ paddingBlockEnd: spaceVar(paddingBlockEnd),
126
+ paddingInlineStart: spaceVar(paddingInlineStart),
127
+ paddingInlineEnd: spaceVar(paddingInlineEnd),
128
+ };
129
+
109
130
  return (
110
131
  <Component
111
132
  href={href}
@@ -129,6 +150,7 @@ export function Card({
129
150
  !body && padding && paddingClass(padding),
130
151
  className,
131
152
  )}
153
+ style={{ minHeight, ...(body ? {} : sides), ...style }}
132
154
  {...props}
133
155
  >
134
156
  {body && (
@@ -151,7 +173,10 @@ export function Card({
151
173
  </div>
152
174
  )}
153
175
  {body ? (
154
- <div className={cn("flex min-h-0 grow flex-col gap-4", padding ? paddingClass(padding) : "px-4 pt-3 pb-4")}>
176
+ <div
177
+ className={cn("flex min-h-0 grow flex-col gap-4", padding ? paddingClass(padding) : "px-4 pt-3 pb-4")}
178
+ style={sides}
179
+ >
155
180
  {children}
156
181
  </div>
157
182
  ) : (
@@ -45,7 +45,7 @@ const contentVariants = cva(
45
45
  default: [
46
46
  "inset-0 h-dvh max-h-dvh w-screen max-w-[100vw]",
47
47
  "data-[state=open]:zoom-in-0 data-[state=closed]:fade-out-0",
48
- "md:inset-auto md:top-1/2 md:left-1/2 md:h-auto md:max-h-[90dvh] md:w-[90vw] md:-translate-x-1/2 md:-translate-y-1/2",
48
+ "md:inset-auto md:top-1/2 md:left-1/2 md:h-auto md:max-h-[var(--dialog-max-height,90dvh)] md:w-[90vw] md:-translate-x-1/2 md:-translate-y-1/2",
49
49
  "md:rounded-base md:shadow-level-3",
50
50
  ],
51
51
  drawer: [
@@ -91,6 +91,8 @@ export interface DialogContentProps
91
91
  secondaryActionLabel?: string;
92
92
  onPrimaryAction?: () => void;
93
93
  onSecondaryAction?: () => void;
94
+ /** A footer of your own, such as a row of buttons, in place of the action buttons. Swirl's `custom-footer` slot. */
95
+ customFooter?: React.ReactNode;
94
96
  /** Tools under the header, such as a search field. */
95
97
  headerTools?: React.ReactNode;
96
98
  /** A second column beside the content from 992px (Swirl's breakpoint, not Tailwind's `lg`), and under it below. */
@@ -105,6 +107,8 @@ export interface DialogContentProps
105
107
  sidebarFooterPadded?: boolean;
106
108
  /** CSS max width, overriding Swirl's 40rem. */
107
109
  maxWidth?: string;
110
+ /** CSS max height from 768px, overriding Swirl's 90dvh. Phones stay full screen. */
111
+ maxHeight?: string;
108
112
  }
109
113
 
110
114
  /**
@@ -167,6 +171,7 @@ export function DialogContent({
167
171
  secondaryActionLabel,
168
172
  onPrimaryAction,
169
173
  onSecondaryAction,
174
+ customFooter,
170
175
  headerTools,
171
176
  secondaryContent,
172
177
  hideSecondaryContentBorders = false,
@@ -176,6 +181,7 @@ export function DialogContent({
176
181
  sidebarPadded = true,
177
182
  sidebarFooterPadded = true,
178
183
  maxWidth,
184
+ maxHeight,
179
185
  style,
180
186
  ...props
181
187
  }: DialogContentProps) {
@@ -186,7 +192,9 @@ export function DialogContent({
186
192
  const hasSecondary = secondaryContent !== undefined;
187
193
  const hasSidebar = sidebarContent !== undefined;
188
194
  const hasTools = headerTools !== undefined;
189
- const hasControls = Boolean(primaryActionLabel || secondaryActionLabel);
195
+ const hasCustomFooter = customFooter !== undefined && customFooter !== null;
196
+ // A custom footer replaces the action buttons, as in Swirl.
197
+ const hasControls = !hasCustomFooter && Boolean(primaryActionLabel || secondaryActionLabel);
190
198
  const secondaryBorders = hasSecondary && !hideSecondaryContentBorders;
191
199
 
192
200
  const id = React.useId();
@@ -204,7 +212,11 @@ export function DialogContent({
204
212
  // A labelled modal needs no description; leave Radix's wiring alone otherwise.
205
213
  {...(label ? { "aria-describedby": undefined } : {})}
206
214
  className={cn(variantName !== "sheet" && width, contentVariants({ variant, size }), className)}
207
- style={{ ...(maxWidth ? { maxWidth } : {}), ...style }}
215
+ style={{
216
+ ...(maxWidth ? { maxWidth } : {}),
217
+ ...(maxHeight ? ({ "--dialog-max-height": maxHeight } as React.CSSProperties) : {}),
218
+ ...style,
219
+ }}
208
220
  {...props}
209
221
  >
210
222
  {hasSidebar && (
@@ -339,20 +351,25 @@ export function DialogContent({
339
351
  )}
340
352
  </div>
341
353
 
342
- {hasControls && (
354
+ {(hasControls || hasCustomFooter) && (
343
355
  <footer
344
356
  className={cn(
345
- "flex shrink-0 justify-end",
357
+ "shrink-0",
358
+ !hasCustomFooter && "flex justify-end",
346
359
  "px-4 pt-3 pb-[max(env(safe-area-inset-bottom),0.75rem)] md:px-6 md:pt-4 md:pb-[max(env(safe-area-inset-bottom),1rem)]",
347
360
  ((main.scrollable && !main.atEnd) || secondaryBorders) && "border-t border-border",
348
361
  )}
349
362
  >
350
- <div className="flex flex-wrap justify-end gap-2">
351
- {secondaryActionLabel && <Button label={secondaryActionLabel} onClick={onSecondaryAction} />}
352
- {primaryActionLabel && (
353
- <Button variant="flat" intent="primary" label={primaryActionLabel} onClick={onPrimaryAction} />
354
- )}
355
- </div>
363
+ {hasCustomFooter ? (
364
+ customFooter
365
+ ) : (
366
+ <div className="flex flex-wrap justify-end gap-2">
367
+ {secondaryActionLabel && <Button label={secondaryActionLabel} onClick={onSecondaryAction} />}
368
+ {primaryActionLabel && (
369
+ <Button variant="flat" intent="primary" label={primaryActionLabel} onClick={onPrimaryAction} />
370
+ )}
371
+ </div>
372
+ )}
356
373
  </footer>
357
374
  )}
358
375
  </div>
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { cn } from "../lib/utils";
3
3
  import { Glyph } from "../lib/glyphs";
4
- import { gap, type SwirlSpacing } from "../lib/spacing";
4
+ import { gap, spaceVar as space, type SwirlSpacing } from "../lib/spacing";
5
5
  import { Button } from "./button";
6
6
  import { InlineError } from "./inline-status";
7
7
  import { Separator } from "./separator";
@@ -49,8 +49,6 @@ function setTabStop(list: HTMLElement, index: number) {
49
49
  }
50
50
  const ITEM = "data-resource-list-item";
51
51
 
52
- const space = (s: SwirlSpacing | undefined) => (s === undefined ? undefined : `var(--s-space-${s})`);
53
-
54
52
  /* ------------------------------------------------------------------- list */
55
53
 
56
54
  export interface ResourceListItemDrop {
@@ -0,0 +1,77 @@
1
+ import * as React from "react";
2
+ import { cn } from "../lib/utils";
3
+ import type { BadgeIntent } from "./badge";
4
+ import { Tabs, TabsList, TabsTrigger } from "./tabs";
5
+
6
+ export interface TabBarTab {
7
+ id: string;
8
+ label: React.ReactNode;
9
+ /** The selected tab. Mark one. */
10
+ active?: boolean;
11
+ /** Leading icon, 20px. */
12
+ icon?: React.ReactNode;
13
+ /** Quiet text after the label, such as a count. */
14
+ suffix?: React.ReactNode;
15
+ /** A status dot after the label. `label` names it for screen readers. */
16
+ badge?: { label: string; intent?: BadgeIntent };
17
+ /** Help text shown in a tooltip on hover and focus. */
18
+ tooltip?: React.ReactNode;
19
+ }
20
+
21
+ export interface TabBarProps extends Omit<React.ComponentProps<"div">, "children"> {
22
+ tabs: TabBarTab[];
23
+ /** The tab list's accessible name. */
24
+ label?: string;
25
+ /** `default` is Swirl's underlined bar, `pill` its pill bar. */
26
+ variant?: "default" | "pill";
27
+ /** `evenly` shares the row between the tabs. */
28
+ justify?: "start" | "evenly";
29
+ /** Wrap the tabs onto more rows, rather than scrolling sideways. */
30
+ wrap?: boolean;
31
+ /** Called with a tab's `id` when it is clicked, or chosen with Enter or Space. */
32
+ onActivateTab?: (id: string) => void;
33
+ }
34
+
35
+ /**
36
+ * Swirl's tab bar: a row of tabs drawn from data, with the selection held by
37
+ * the caller. Arrow keys move focus between the tabs and Enter or Space picks
38
+ * one, as in Swirl, so it suits navigation as well as panels. For panels
39
+ * that swirlcn shows and hides itself, use `Tabs`.
40
+ */
41
+ export function TabBar({
42
+ tabs,
43
+ label,
44
+ variant = "default",
45
+ justify = "start",
46
+ wrap = false,
47
+ onActivateTab,
48
+ className,
49
+ ...props
50
+ }: TabBarProps) {
51
+ const active = tabs.find((tab) => tab.active)?.id ?? "";
52
+
53
+ return (
54
+ <Tabs value={active} onValueChange={onActivateTab} activationMode="manual">
55
+ <TabsList
56
+ aria-label={label}
57
+ variant={variant === "pill" ? "pill" : "underline"}
58
+ stretch={justify === "evenly"}
59
+ className={cn(wrap && "flex-wrap", className)}
60
+ {...props}
61
+ >
62
+ {tabs.map((tab) => (
63
+ <TabsTrigger
64
+ key={tab.id}
65
+ value={tab.id}
66
+ icon={tab.icon}
67
+ suffix={tab.suffix}
68
+ badge={tab.badge}
69
+ tooltip={tab.tooltip}
70
+ >
71
+ {tab.label}
72
+ </TabsTrigger>
73
+ ))}
74
+ </TabsList>
75
+ </Tabs>
76
+ );
77
+ }
package/src/index.ts CHANGED
@@ -56,6 +56,9 @@ export {
56
56
  } from "./components/card";
57
57
  export type { CardProps } from "./components/card";
58
58
 
59
+ export { AppBar } from "./components/app-bar";
60
+ export type { AppBarProps } from "./components/app-bar";
61
+
59
62
  /* Status + content markers */
60
63
  export { Badge, badgeVariants } from "./components/badge";
61
64
  export type { BadgeProps, BadgeIntent } from "./components/badge";
@@ -214,6 +217,8 @@ export type {
214
217
  /* Navigation + disclosure */
215
218
  export { Tabs, TabsContent, TabsList, TabsTrigger } from "./components/tabs";
216
219
  export type { TabsListProps } from "./components/tabs";
220
+ export { TabBar } from "./components/tab-bar";
221
+ export type { TabBarProps, TabBarTab } from "./components/tab-bar";
217
222
 
218
223
  export {
219
224
  Accordion,
package/src/lib/glyphs.ts CHANGED
@@ -11,6 +11,9 @@ const GLYPHS = {
11
11
  arrowBack: [
12
12
  { d: "M14.2614 19.6671L7.24967 12.6762C7.16645 12.5791 7.10403 12.4751 7.06242 12.3641C7.02081 12.2531 7 12.1352 7 12.0104C7 11.8856 7.02081 11.7677 7.06242 11.6567C7.10403 11.5457 7.16645 11.4417 7.24967 11.3446L14.2614 4.3329C14.4833 4.11097 14.7574 4 15.0836 4C15.4093 4 15.6831 4.1179 15.9051 4.35371C16.1409 4.57564 16.2588 4.84251 16.2588 5.15433C16.2588 5.4667 16.1409 5.74079 15.9051 5.97659L9.87126 12.0104L15.9051 18.0442C16.127 18.2661 16.238 18.533 16.238 18.8448C16.238 19.1572 16.1201 19.4313 15.8843 19.6671C15.6623 19.889 15.3952 20 15.0828 20C14.771 20 14.4972 19.889 14.2614 19.6671Z" },
13
13
  ],
14
+ arrowDownward: [
15
+ { d: "M12 19.575C11.8667 19.575 11.7417 19.554 11.625 19.512C11.5083 19.4707 11.4 19.4 11.3 19.3L4.7 12.7C4.5 12.5 4.4 12.2623 4.4 11.987C4.4 11.7123 4.5 11.475 4.7 11.275C4.9 11.075 5.13333 10.975 5.4 10.975C5.66667 10.975 5.9 11.075 6.1 11.275L11 16.175V4.975C11 4.69167 11.096 4.45833 11.288 4.275C11.4793 4.09167 11.7167 4 12 4C12.2833 4 12.521 4.09567 12.713 4.287C12.9043 4.479 13 4.71667 13 5V16.175L17.9 11.275C18.1 11.075 18.3333 10.975 18.6 10.975C18.8667 10.975 19.1 11.075 19.3 11.275C19.5 11.475 19.6 11.7123 19.6 11.987C19.6 12.2623 19.5 12.5 19.3 12.7L12.7 19.3C12.6 19.4 12.4917 19.4707 12.375 19.512C12.2583 19.554 12.1333 19.575 12 19.575Z" },
16
+ ],
14
17
  arrowForward: [
15
18
  { d: "M9.73739 19.6671L16.7491 12.6762C16.8323 12.5791 16.8947 12.4751 16.9363 12.3641C16.978 12.2531 16.9988 12.1352 16.9988 12.0104C16.9988 11.8856 16.978 11.7677 16.9363 11.6567C16.8947 11.5457 16.8323 11.4417 16.7491 11.3446L9.73739 4.3329C9.51546 4.11097 9.24137 4 8.91513 4C8.58944 4 8.31563 4.1179 8.0937 4.35371C7.85789 4.57564 7.73999 4.84251 7.73999 5.15433C7.73999 5.4667 7.85789 5.74079 8.0937 5.97659L14.1275 12.0104L8.0937 18.0442C7.87176 18.2661 7.7608 18.533 7.7608 18.8448C7.7608 19.1572 7.8787 19.4313 8.1145 19.6671C8.33643 19.889 8.60359 20 8.91596 20C9.22778 20 9.50159 19.889 9.73739 19.6671Z" },
16
19
  ],
@@ -22,6 +25,9 @@ const GLYPHS = {
22
25
  arrowRight: [
23
26
  { d: "M11.2 19.2999C10.9833 19.0832 10.871 18.8166 10.863 18.4999C10.8543 18.1832 10.9583 17.9166 11.175 17.6999L15.725 13.1499H5.05C4.73333 13.1499 4.46267 13.0372 4.238 12.8119C4.01267 12.5872 3.9 12.3166 3.9 11.9999C3.9 11.6832 4.01267 11.4126 4.238 11.1879C4.46267 10.9626 4.73333 10.8499 5.05 10.8499H15.725L11.175 6.2999C10.9583 6.08324 10.8543 5.81657 10.863 5.4999C10.871 5.18324 10.9833 4.91657 11.2 4.6999C11.4167 4.4999 11.6833 4.3999 12 4.3999C12.3167 4.3999 12.5833 4.4999 12.8 4.6999L19.3 11.1999C19.4167 11.2999 19.5 11.4206 19.55 11.5619C19.6 11.7039 19.625 11.8499 19.625 11.9999C19.625 12.1499 19.6 12.2916 19.55 12.4249C19.5 12.5582 19.4167 12.6832 19.3 12.7999L12.8 19.2999C12.5833 19.5166 12.3167 19.6209 12 19.6129C11.6833 19.6042 11.4167 19.4999 11.2 19.2999V19.2999Z" },
24
27
  ],
28
+ arrowUpward: [
29
+ { d: "M12 20C11.7167 20 11.4793 19.904 11.288 19.712C11.096 19.5207 11 19.2834 11 19V7.82505L6.125 12.7C5.925 12.9 5.68733 13 5.412 13C5.13733 13 4.9 12.9 4.7 12.7C4.5 12.5 4.4 12.2667 4.4 12C4.4 11.7334 4.5 11.5 4.7 11.3L11.3 4.70005C11.4 4.60005 11.5083 4.52905 11.625 4.48705C11.7417 4.44572 11.8667 4.42505 12 4.42505C12.1333 4.42505 12.2627 4.44572 12.388 4.48705C12.5127 4.52905 12.6167 4.60005 12.7 4.70005L19.3 11.3C19.5 11.5 19.6 11.7334 19.6 12C19.6 12.2667 19.5 12.5 19.3 12.7C19.1 12.9 18.8623 13 18.587 13C18.3123 13 18.075 12.9 17.875 12.7L13 7.82505V19C13 19.2834 12.9043 19.5207 12.713 19.712C12.521 19.904 12.2833 20 12 20Z" },
30
+ ],
25
31
  attachment: [
26
32
  { d: "M12.8574 19.3194C11.726 20.4507 10.3738 21.0134 8.80068 21.0072C7.22713 21.0016 5.88057 20.439 4.76098 19.3194C3.62961 18.188 3.0611 16.8355 3.05544 15.262C3.04931 13.6889 3.61193 12.3367 4.7433 11.2053L12.2386 3.70999C13.0518 2.89682 14.0387 2.49306 15.1993 2.49872C16.3604 2.50484 17.3475 2.91449 18.1607 3.72767C18.9738 4.54084 19.3804 5.5249 19.3804 6.67984C19.3804 7.83478 18.9738 8.81884 18.1607 9.63201L11.4078 16.3849C10.8892 16.9034 10.2677 17.1658 9.54314 17.1719C8.81812 17.1775 8.19634 16.9211 7.6778 16.4026C7.14747 15.8722 6.88536 15.2448 6.89149 14.5202C6.89715 13.7952 7.15925 13.1734 7.6778 12.6549L13.8296 6.50306C13.9946 6.33807 14.1919 6.25251 14.4215 6.24638C14.6515 6.24072 14.8549 6.32628 15.0317 6.50306C15.1967 6.66805 15.2764 6.86557 15.2707 7.09562C15.2646 7.32519 15.179 7.52247 15.014 7.68747L8.8622 13.8393C8.67364 14.0279 8.57936 14.2518 8.57936 14.511C8.57936 14.7703 8.67953 15.0001 8.87988 15.2005C9.06844 15.389 9.29236 15.4833 9.55163 15.4833C9.8109 15.4833 10.0348 15.389 10.2234 15.2005L16.9762 8.4476C17.4712 7.95263 17.7187 7.36337 17.7187 6.67984C17.7187 5.9963 17.4712 5.40704 16.9762 4.91207C16.4813 4.4171 15.892 4.16961 15.2085 4.16961C14.5249 4.16961 13.9357 4.4171 13.4407 4.91207L5.94538 12.4074C5.15578 13.197 4.76098 14.1514 4.76098 15.2705C4.76098 16.3905 5.15578 17.3454 5.94538 18.135C6.73499 18.9246 7.68675 19.3163 8.80068 19.3102C9.91414 19.3045 10.8657 18.9069 11.6553 18.1173L18.5496 11.223C18.7146 11.058 18.9149 10.9755 19.1506 10.9755C19.3863 10.9755 19.5867 11.058 19.7516 11.223C19.9284 11.3998 20.0137 11.603 20.0076 11.8325C20.002 12.0626 19.9166 12.2601 19.7516 12.4251L12.8574 19.3194Z" },
27
33
  ],
@@ -91,3 +91,10 @@ export const gap = (s: SwirlSpacing) => gaps[s];
91
91
  export const gapX = (s: SwirlSpacing) => columnGaps[s];
92
92
  export const gapY = (s: SwirlSpacing) => rowGaps[s];
93
93
  export const padding = (s: SwirlSpacing) => paddings[s];
94
+
95
+ /**
96
+ * `spaceVar("16")` -> `"var(--s-space-16)"`, for inline styles such as a
97
+ * single side's padding, which Swirl sets per side and per component.
98
+ */
99
+ export const spaceVar = (s: SwirlSpacing | undefined) =>
100
+ s === undefined ? undefined : `var(--s-space-${s})`;