@manakind/ui-core 0.25.0 → 0.26.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 +7 -5
- package/dist/alert/alert.js.map +1 -1
- package/dist/alert/index.js.map +1 -1
- package/dist/avatar/avatar.js.map +1 -1
- package/dist/avatar/index.js.map +1 -1
- package/dist/badge/badge.js.map +1 -1
- package/dist/badge/index.js.map +1 -1
- package/dist/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/breadcrumb/index.js.map +1 -1
- package/dist/button/button.js.map +1 -1
- package/dist/button/icon-button.d.ts +11 -3
- package/dist/button/icon-button.d.ts.map +1 -1
- package/dist/button/icon-button.js +5 -3
- package/dist/button/icon-button.js.map +1 -1
- package/dist/button/index.js.map +1 -1
- package/dist/calendar/calendar.js.map +1 -1
- package/dist/calendar/index.js.map +1 -1
- package/dist/card/card.js.map +1 -1
- package/dist/card/index.js.map +1 -1
- package/dist/centered-layout/centered-layout.js.map +1 -1
- package/dist/centered-layout/index.js.map +1 -1
- package/dist/checkbox/checkbox.js.map +1 -1
- package/dist/checkbox/index.js.map +1 -1
- package/dist/combobox/combobox.d.ts.map +1 -1
- package/dist/combobox/combobox.js +3 -2
- package/dist/combobox/combobox.js.map +1 -1
- package/dist/combobox/index.js.map +1 -1
- package/dist/cx.js.map +1 -1
- package/dist/date-input/date-input.js.map +1 -1
- package/dist/date-input/index.js.map +1 -1
- package/dist/dialog/dialog-close.js.map +1 -1
- package/dist/dialog/dialog.js.map +1 -1
- package/dist/dialog/index.js.map +1 -1
- package/dist/divider/divider.js.map +1 -1
- package/dist/divider/index.js.map +1 -1
- package/dist/empty-state/empty-state.js.map +1 -1
- package/dist/empty-state/index.js.map +1 -1
- package/dist/fallback-glyphs.js.map +1 -1
- package/dist/field/field.js.map +1 -1
- package/dist/field/index.js.map +1 -1
- package/dist/field/input.js.map +1 -1
- package/dist/field/textarea.js.map +1 -1
- package/dist/field/use-field-control.js.map +1 -1
- package/dist/form-layout/form-layout.js.map +1 -1
- package/dist/form-layout/index.js.map +1 -1
- package/dist/group-items.js.map +1 -1
- package/dist/icon/icon.js.map +1 -1
- package/dist/icon/index.js.map +1 -1
- package/dist/illustration/illustration.js.map +1 -1
- package/dist/illustration/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/iso-date.js.map +1 -1
- package/dist/layout/index.js.map +1 -1
- package/dist/layout/layout.js.map +1 -1
- package/dist/link/index.js.map +1 -1
- package/dist/link/link.js.map +1 -1
- package/dist/link-component.js.map +1 -1
- package/dist/menu/action-menu.js.map +1 -1
- package/dist/menu/index.js.map +1 -1
- package/dist/menu/menu.js.map +1 -1
- package/dist/page-layout/index.js.map +1 -1
- package/dist/page-layout/page-layout.js.map +1 -1
- package/dist/popover/index.js.map +1 -1
- package/dist/popover/popover.js.map +1 -1
- package/dist/portal-container.js.map +1 -1
- package/dist/progress/index.js.map +1 -1
- package/dist/progress/progress.js.map +1 -1
- package/dist/reorder-control/index.js.map +1 -1
- package/dist/reorder-control/reorder-control.js.map +1 -1
- package/dist/scroll-area/index.js.map +1 -1
- package/dist/scroll-area/scroll-area.js.map +1 -1
- package/dist/section/index.js.map +1 -1
- package/dist/section/section.js.map +1 -1
- package/dist/segment-group/index.d.ts +1 -1
- package/dist/segment-group/index.d.ts.map +1 -1
- package/dist/segment-group/index.js.map +1 -1
- package/dist/segment-group/segment-group.css +63 -3
- package/dist/segment-group/segment-group.d.ts +27 -1
- package/dist/segment-group/segment-group.d.ts.map +1 -1
- package/dist/segment-group/segment-group.js +11 -2
- package/dist/segment-group/segment-group.js.map +1 -1
- package/dist/select/index.js.map +1 -1
- package/dist/select/select.css +3 -3
- package/dist/select/select.js.map +1 -1
- package/dist/show/index.js.map +1 -1
- package/dist/show/show.js.map +1 -1
- package/dist/skeleton/index.js.map +1 -1
- package/dist/skeleton/skeleton.js.map +1 -1
- package/dist/slider/index.js.map +1 -1
- package/dist/slider/slider.css +5 -3
- package/dist/slider/slider.js.map +1 -1
- package/dist/spinner/index.js.map +1 -1
- package/dist/spinner/spinner.js.map +1 -1
- package/dist/split-layout/index.js.map +1 -1
- package/dist/split-layout/split-layout.js.map +1 -1
- package/dist/sticky/index.js.map +1 -1
- package/dist/sticky/sticky.js.map +1 -1
- package/dist/switch/index.js.map +1 -1
- package/dist/switch/switch.js.map +1 -1
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/tabs.js.map +1 -1
- package/dist/text/index.js.map +1 -1
- package/dist/text/text.js.map +1 -1
- package/dist/tooltip/index.d.ts +2 -0
- package/dist/tooltip/index.d.ts.map +1 -0
- package/dist/tooltip/index.js +2 -0
- package/dist/tooltip/index.js.map +1 -0
- package/dist/tooltip/tooltip.css +20 -0
- package/dist/tooltip/tooltip.css.d.ts +2 -0
- package/dist/tooltip/tooltip.d.ts +38 -0
- package/dist/tooltip/tooltip.d.ts.map +1 -0
- package/dist/tooltip/tooltip.js +41 -0
- package/dist/tooltip/tooltip.js.map +1 -0
- package/dist/visually-hidden/index.js.map +1 -1
- package/dist/visually-hidden/visually-hidden.js.map +1 -1
- package/dist/wizard-layout/index.js.map +1 -1
- package/dist/wizard-layout/wizard-layout.js.map +1 -1
- package/package.json +10 -2
package/README.md
CHANGED
|
@@ -82,6 +82,7 @@ separately, so an app can load only what it renders.
|
|
|
82
82
|
| `@manakind/ui-core/tabs` | `Tabs`, `TabsList`, `TabsTrigger`, `TabsContent` |
|
|
83
83
|
| `@manakind/ui-core/layout` | `Stack`, `Inline`, `Grid`, `Container`, `Frame`, `Spacer` and the layout step types |
|
|
84
84
|
| `@manakind/ui-core/text` | `Text` + `Heading` |
|
|
85
|
+
| `@manakind/ui-core/tooltip` | `Tooltip` |
|
|
85
86
|
| `@manakind/ui-core/link` | `Link` |
|
|
86
87
|
| `@manakind/ui-core/divider` | `Divider` |
|
|
87
88
|
| `@manakind/ui-core/show` | `Show` |
|
|
@@ -103,19 +104,19 @@ separately, so an app can load only what it renders.
|
|
|
103
104
|
| `@manakind/ui-core/css/avatar` | Avatar structural CSS; its fallback glyph also needs `css/icon` |
|
|
104
105
|
| `@manakind/ui-core/css/badge` | Badge structural CSS |
|
|
105
106
|
| `@manakind/ui-core/css/breadcrumb` | Breadcrumb structural CSS; a custom separator also needs `css/icon` |
|
|
106
|
-
| `@manakind/ui-core/css/button` | Button + IconButton structural CSS |
|
|
107
|
-
| `@manakind/ui-core/css/calendar` | Calendar structural CSS; its paging buttons also need `css/button` and `css/
|
|
107
|
+
| `@manakind/ui-core/css/button` | Button + IconButton structural CSS; IconButton's caption also needs `css/tooltip` |
|
|
108
|
+
| `@manakind/ui-core/css/calendar` | Calendar structural CSS; its paging buttons also need `css/button`, `css/icon` and `css/tooltip` |
|
|
108
109
|
| `@manakind/ui-core/css/card` | Card structural CSS |
|
|
109
|
-
| `@manakind/ui-core/css/dialog` | Dialog structural CSS; its close button also needs `css/button` and `css/
|
|
110
|
+
| `@manakind/ui-core/css/dialog` | Dialog structural CSS; its close button also needs `css/button`, `css/icon` and `css/tooltip` |
|
|
110
111
|
| `@manakind/ui-core/css/icon` | Icon structural CSS |
|
|
111
112
|
| `@manakind/ui-core/css/illustration` | Illustration structural CSS, including the paint roles |
|
|
112
113
|
| `@manakind/ui-core/css/menu` | Menu and ActionMenu structural CSS; an ActionMenu's glyphs also need `css/icon` |
|
|
113
114
|
| `@manakind/ui-core/css/popover` | Popover structural CSS |
|
|
114
115
|
| `@manakind/ui-core/css/checkbox` | Checkbox structural CSS |
|
|
115
|
-
| `@manakind/ui-core/css/combobox` | Combobox structural CSS |
|
|
116
|
+
| `@manakind/ui-core/css/combobox` | Combobox structural CSS; its pin and chip-remove captions also need `css/tooltip` |
|
|
116
117
|
| `@manakind/ui-core/css/date-input` | DateInput structural CSS |
|
|
117
118
|
| `@manakind/ui-core/css/progress` | Progress structural CSS |
|
|
118
|
-
| `@manakind/ui-core/css/reorder-control` | ReorderControl structural CSS; its handle and input also need `css/button`, `css/icon` and `css/
|
|
119
|
+
| `@manakind/ui-core/css/reorder-control` | ReorderControl structural CSS; its handle and input also need `css/button`, `css/icon`, `css/field` and `css/tooltip` |
|
|
119
120
|
| `@manakind/ui-core/css/segment-group` | SegmentGroup structural CSS |
|
|
120
121
|
| `@manakind/ui-core/css/select` | Select structural CSS |
|
|
121
122
|
| `@manakind/ui-core/css/switch` | Switch structural CSS |
|
|
@@ -123,6 +124,7 @@ separately, so an app can load only what it renders.
|
|
|
123
124
|
| `@manakind/ui-core/css/tabs` | Tabs structural CSS |
|
|
124
125
|
| `@manakind/ui-core/css/layout` | Stack, Inline, Grid, Container, Frame and Spacer structural CSS |
|
|
125
126
|
| `@manakind/ui-core/css/text` | Text and Heading structural CSS |
|
|
127
|
+
| `@manakind/ui-core/css/tooltip` | Tooltip structural CSS |
|
|
126
128
|
| `@manakind/ui-core/css/link` | Link structural CSS |
|
|
127
129
|
| `@manakind/ui-core/css/divider` | Divider structural CSS |
|
|
128
130
|
| `@manakind/ui-core/css/show` | Show structural CSS |
|
package/dist/alert/alert.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.js","sourceRoot":"","sources":["../../src/alert/alert.tsx"],"names":[],"mappings":";AACA,OAAO,aAAa,CAAC;AACrB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,IAAI,EAAmB,MAAM,SAAS,CAAC;AAahD,MAAM,YAAY,GAAoC;IACpD,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,QAAQ;IACjB,OAAO,EAAE,OAAO;IAChB,MAAM,EAAE,OAAO;CAChB,CAAC;AAwBF;;;;;;;;;GASG;AACH,MAAM,UAAU,KAAK,CAAC,EACpB,OAAO,GAAG,MAAM,EAChB,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,GAAG,IAAI,EACI;IACX,OAAO,CACL,eACE,I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,SAAG,GAC5B,CACR,EACD,eAAK,SAAS,EAAC,gBAAgB,aAC5B,KAAK,IAAI,IAAI,IAAI,YAAG,SAAS,EAAC,iBAAiB,YAAE,KAAK,GAAK,EAC3D,QAAQ,IAAI,IAAI,IAAI,cAAK,SAAS,EAAC,uBAAuB,YAAE,QAAQ,GAAO,IACxE,IACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["import type { ComponentProps, ReactNode } from 'react';\nimport './alert.css';\nimport { cx } from '../cx';\nimport { Icon, type IconSource } from '../icon';\n\nexport type AlertVariant = 'info' | 'success' | 'warning' | 'danger';\n\n/**\n * `alert` interrupts, and is announced when the element is inserted. `status`\n * waits until the reader is idle, and assistive tech announces only changes\n * inside a region it already knows about: a `status` alert mounted with its\n * content may go unannounced, so keep it mounted and change its text, or use\n * `alert`. Warnings and failures interrupt by default, the other two do not.\n */\nexport type AlertRole = 'status' | 'alert';\n\nconst DEFAULT_ROLE: Record<AlertVariant, AlertRole> = {\n info: 'status',\n success: 'status',\n warning: 'alert',\n danger: 'alert',\n};\n\nexport type AlertProps = Omit<ComponentProps<'div'>, 'role' | 'title'> & {\n /**\n * Tone and colour. `info` is the default; `warning` and `danger` also change\n * the live-region role (see {@link AlertRole}).\n */\n variant?: AlertVariant;\n /**\n * Live-region role. Leave it unset and the variant picks one.\n */\n role?: AlertRole;\n /** The one-line headline. Keep it to what happened. */\n title?: ReactNode;\n /**\n * Glyph before the text. Decorative: the variant's role and text say what\n * kind of message this is. `ui-core` ships no icons, so a product passes\n * one of its own.\n */\n icon?: IconSource;\n /** The message body: what to do about it. */\n children?: ReactNode;\n};\n\n/**\n * An inline message about the surrounding content: a failed save, a setting\n * that needs attention, a result worth confirming. It stays in the flow of the\n * page; a message about the whole app is a toast, and a question is a Dialog.\n *\n * Give it a `title`, `children`, or both. A title alone is a short notice; a\n * body alone is a sentence of explanation. The variant's text colour clears\n * 4.5:1 on its own fill in both themes, and the border is that same colour,\n * so the box is bounded on any surface.\n */\nexport function Alert({\n variant = 'info',\n role,\n title,\n icon,\n children,\n className,\n ...rest\n}: AlertProps) {\n return (\n <div\n role={role ?? DEFAULT_ROLE[variant]}\n className={cx('ds-alert', `ds-alert--${variant}`, className)}\n {...rest}\n >\n {icon && (\n <span className=\"ds-alert__icon\">\n <Icon source={icon} decorative />\n </span>\n )}\n <div className=\"ds-alert__body\">\n {title != null && <p className=\"ds-alert__title\">{title}</p>}\n {children != null && <div className=\"ds-alert__description\">{children}</div>}\n </div>\n </div>\n );\n}\n"]}
|
package/dist/alert/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/alert/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/alert/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC","sourcesContent":["export type { AlertProps, AlertRole, AlertVariant } from './alert';\nexport { Alert } from './alert';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.js","sourceRoot":"","sources":["../../src/avatar/avatar.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;AACrD,OAAO,cAAc,CAAC;AAgCtB;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACvD,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACvB,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IACnC,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAA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AE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,SAAG,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7E,MAAM,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;IAEzF,OAAO,CACL,eAAM,SAAS,EAAE,EAAE,CAAC,WAAW,EAAE,cAAc,IAAI,EAAE,EAAE,SAAS,CAAC,KAAM,IAAI,KAAM,KAAK,YACnF,QAAQ,IAAI,QAAQ,GAChB,CACR,CAAC;AACJ,CAAC","sourcesContent":["import type { ComponentProps } from 'react';\nimport { cx } from '../cx';\nimport { Icon, type IconSource } from '../icon/icon';\nimport './avatar.css';\n\nexport type AvatarSize = 'sm' | 'md' | 'lg';\n\n/**\n * An avatar beside the name it stands for is decorative; one standing alone,\n * such as the content of a menu trigger whose button has no name of its\n * own, needs a label. The pairing is a compile error rather than a\n * convention, mirroring `IconProps`.\n */\ntype AvatarA11y = { label: string; decorative?: never } | { decorative: true; label?: never };\n\nexport type AvatarProps = Omit<\n ComponentProps<'span'>,\n 'children' | 'aria-label' | 'aria-hidden' | 'role'\n> &\n AvatarA11y & {\n /**\n * The person's name. The avatar shows its initials: the first letter of\n * the first and last words, or the first two letters of a single word.\n */\n name: string;\n /**\n * Glyph shown when the name yields no initials, such as a person glyph for\n * an account without a name. Decorative; without it the avatar is a bare\n * disc.\n */\n icon?: IconSource;\n /** `sm` fits a toolbar, `md` a row, `lg` a profile heading. */\n size?: AvatarSize;\n };\n\n/**\n * The letters an `Avatar` shows for a name: the first letter of the first\n * and last words (\"Pål Taule Brentebråten\" → \"PB\"), the first two letters of\n * a single word (\"Manuia\" → \"MA\"), nothing for an empty name. Upper-cased\n * with the runtime's locale rules, so an initial that changes case by\n * length comes out right.\n */\nexport function initialsOf(name: string): string {\n const words = name.trim().split(/\\s+/).filter(Boolean);\n const first = words[0];\n if (first === undefined) return '';\n const last = words.length > 1 ? words[words.length - 1] : undefined;\n const letters =\n last === undefined\n ? Array.from(first).slice(0, 2)\n : [Array.from(first)[0], Array.from(last)[0]];\n return letters.join('').toLocaleUpperCase();\n}\n\n/**\n * A person, as initials in a disc.\n *\n * Renders a `span`. Labelled, it is `role=\"img\"` named by `label`; decorative,\n * it is hidden from assistive technology and the text beside it carries the\n * name. The look comes from the `--ds-avatar-*` keys.\n *\n * ```tsx\n * <Avatar name={user.name} icon={PersonGlyph} decorative />\n * <span>{user.name}</span>\n * ```\n */\nexport function Avatar({\n name,\n icon,\n size = 'md',\n label,\n decorative,\n className,\n ...props\n}: AvatarProps) {\n const initials = initialsOf(name);\n const fallback = icon ? <Icon source={icon} size={size} decorative /> : null;\n const a11y = decorative ? { 'aria-hidden': true } : { role: 'img', 'aria-label': label };\n\n return (\n <span className={cx('ds-avatar', `ds-avatar--${size}`, className)} {...a11y} {...props}>\n {initials || fallback}\n </span>\n );\n}\n"]}
|
package/dist/avatar/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/avatar/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/avatar/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export type { AvatarProps, AvatarSize } from './avatar';\nexport { Avatar, initialsOf } from './avatar';\n"]}
|
package/dist/badge/badge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.js","sourceRoot":"","sources":["../../src/badge/badge.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,EAAE,IAAI,EAAmB,MAAM,SAAS,CA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,EAAE,IAAI,EAAmB,MAAM,SAAS,CAAC;AAChD,OAAO,aAAa,CAAC;AACrB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AA4F3B;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,KAAK,CAAC,EACpB,OAAO,GAAG,OAAO,EACjB,KAAK,GAAG,MAAM,EACd,UAAU,GAAG,QAAQ,EACrB,cAAc,EACd,IAAI,EACJ,OAAO,GAAG,KAAK,EACf,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACG;IACX;;;;;;;;;OASG;IACH,MAAM,QAAQ,GAAG,KAAK,CAAC,YAAY,CAAC,KAAK,SAAS,IAAI,KAAK,CAAC,iBAAiB,CAAC,KAAK,SAAS,CAAC;IAE7F;;;OAGG;IACH,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CACnB,eAAM,SAAS,EAAE,EAAE,CAAC,iBAAiB,EAAE,cAAc,CAAC,YAAG,QAAQ,GAAQ,CAC1E,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,CAAC;IAEF,OAAO,CACL,MAAC,GAAG,CAAC,IAAI,IACP,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,EAClC,SAAS,EAAE,EAAE,CACX,UAAU,EACV,aAAa,OAAO,EAAE,EACtB,aAAa,KAAK,EAAE,EACpB,UAAU,KAAK,OAAO,IAAI,iBAAiB,EAC3C,OAAO,IAAI,mBAAmB,EAC9B,SAAS,CACV,KACG,KAAK,aAER,IAAI,IAAI,KAAC,IAAI,IAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAC,IAAI,EAAC,UAAU,SAAG,EACnD,KAAK,IACG,CACZ,CAAC;AACJ,CAAC","sourcesContent":["import { ark } from '@ark-ui/react/factory';\nimport type { ComponentProps } from 'react';\nimport { Icon, type IconSource } from '../icon';\nimport './badge.css';\nimport { cx } from '../cx';\n\nexport type BadgeVariant =\n | 'solid'\n | 'muted'\n | 'outline'\n | 'info'\n | 'success'\n | 'warning'\n | 'danger';\n\nexport type BadgeShape = 'pill' | 'circle';\n\n/**\n * `compact` hides the label, so it may only be used with a glyph to replace it\n * and a name to announce — otherwise the badge is a bare colour chip, and\n * colour alone is never a signal.\n *\n * Expressed as a discriminated union so the pairing is a compile error rather\n * than a convention, mirroring `IconProps`' label/decorative union.\n */\ntype BadgeCompact =\n | { compact: true; icon: IconSource; 'aria-label': string }\n | { compact?: false | undefined; icon?: IconSource };\n\n/**\n * `plain` drops the fill, so a variant's text must read on the surface behind\n * it. Every variant's does except `solid`, whose text colour is made for its\n * own dark fill and disappears without it, so that pairing is a compile error.\n */\ntype BadgeLook =\n | {\n /**\n * Visual treatment.\n *\n * `solid` is the emphatic one — use it sparingly, at most once in a view.\n * `muted` and `outline` are the neutral workhorses. `info`, `success`,\n * `warning`, and `danger` are tinted status treatments.\n */\n variant?: BadgeVariant;\n /**\n * `filled` (default) draws the variant's fill and border. `plain` drops\n * both and keeps the variant's colour on the glyph and label, for a\n * status that sits inside a busier composition and should not add a\n * chip of its own. Its text is then measured against the surface\n * behind it, not against a tint.\n */\n appearance?: 'filled';\n }\n | { variant?: Exclude<BadgeVariant, 'solid'>; appearance: 'plain' };\n\n/**\n * `labelClassName` lets a composition hide the label (a container query, say),\n * so the badge must then carry its own name: without `aria-label` a hidden\n * label leaves the badge unnamed, since the glyph is always decorative.\n * Required here the same way `compact` requires it.\n */\ntype BadgeLabelClass =\n | {\n /**\n * Your own class on the label wrapper, so a composition can style the\n * label — for instance hide it from a container query when space runs\n * out — without selecting `ui-core`'s classes. The wrapper exists only\n * when there is an `icon`, so a label can never be hidden without a glyph\n * left in its place: colour alone is never the signal.\n */\n labelClassName: string;\n 'aria-label': string;\n }\n | { labelClassName?: undefined };\n\nexport type BadgeProps = Omit<ComponentProps<typeof ark.span>, 'asChild'> &\n BadgeCompact &\n BadgeLook &\n BadgeLabelClass & {\n /**\n * `pill` is the default. `circle` is for counts: a true circle at one or two\n * digits, and a fixed-height lozenge beyond that.\n *\n * The height is pinned on purpose — see the note in `badge.css`. An earlier\n * `aspect-ratio` grew a three-digit count in both directions, which made the\n * badge taller than its row and broke the nested radius of any track it sat\n * in.\n *\n * Only use it for short numerics. Words in a circle wrap badly, and past two\n * digits the shape stops being a circle anyway.\n */\n shape?: BadgeShape;\n };\n\nexport type BadgeAppearance = NonNullable<BadgeProps['appearance']>;\n\n/*\n * `icon` and `compact` are declared on `BadgeCompact` above rather than here,\n * so their docs live with the union that constrains them:\n *\n * icon — glyph before the label, supplied by the product so this package\n * never imports an icon set. Always decorative; the label beside\n * it says the same thing, and when the label is collapsed the\n * badge's own `aria-label` carries the name. Announcing both would\n * read the status twice.\n *\n * compact — collapse to the glyph alone: square geometry, no visible label.\n * Requires `icon` and `aria-label`, enforced by the union.\n *\n * For a badge that should collapse only when space runs out, leave `compact`\n * off, pass a `labelClassName`, and hide that class from a container query —\n * GoalCard's status badge is the worked example.\n */\n\n/**\n * Small inline label for counts, states, and categories.\n *\n * Renders a `span`, so a badge is decorative text by default. If the badge\n * carries meaning that is not repeated in nearby text — a count, a status —\n * give it an `aria-label` so it is announced usefully rather than as a bare\n * number. Labelling it also switches it to `role=\"img\"`, because `aria-label`\n * on a role-less `span` is prohibited and would not be announced.\n *\n * A badge is not a button. If it needs to be clickable, put it inside one.\n *\n * Colour alone must never be the only signal a badge carries. Pair a status\n * variant with text (or an `aria-label`) that says the same thing.\n *\n * @example Status that survives a narrow card\n * ```tsx\n * <Badge variant=\"success\" icon={CheckIcon} aria-label=\"Completed\">\n * Completed\n * </Badge>\n * ```\n * Reads as \"Completed\" wide, collapses to the glyph when the container\n * shrinks, and announces the same name at every width.\n */\nexport function Badge({\n variant = 'muted',\n shape = 'pill',\n appearance = 'filled',\n labelClassName,\n icon,\n compact = false,\n className,\n children,\n ...props\n}: BadgeProps) {\n /*\n * ARIA prohibits `aria-label` on a role-less `span` (it resolves to\n * `role=\"generic\"`), so the label is not reliably announced — axe reports\n * `aria-prohibited-attr`. Since the whole point of the label is to replace\n * the bare text, `role=\"img\"` is the honest role: it makes the element a\n * single labelled node and the label becomes its accessible name.\n *\n * Only applied when a label is actually present. An unlabelled badge is\n * decorative text and should stay a plain `span`.\n */\n const labelled = props['aria-label'] !== undefined || props['aria-labelledby'] !== undefined;\n\n /*\n * Wrapped only when there is a glyph, because the wrapper exists to be\n * collapsed against one. A text-only badge keeps its bare-text DOM.\n */\n const label = icon ? (\n <span className={cx('ds-badge__label', labelClassName)}>{children}</span>\n ) : (\n children\n );\n\n return (\n <ark.span\n role={labelled ? 'img' : undefined}\n className={cx(\n 'ds-badge',\n `ds-badge--${variant}`,\n `ds-badge--${shape}`,\n appearance === 'plain' && 'ds-badge--plain',\n compact && 'ds-badge--compact',\n className,\n )}\n {...props}\n >\n {icon && <Icon source={icon} size=\"sm\" decorative />}\n {label}\n </ark.span>\n );\n}\n"]}
|
package/dist/badge/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/badge/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/badge/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC","sourcesContent":["export type { BadgeAppearance, BadgeProps, BadgeShape, BadgeVariant } from './badge';\nexport { Badge } from './badge';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumb.js","sourceRoot":"","sources":["../../src/breadcrumb/breadcrumb.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,IAAI,EAAmB,MAAM,SAAS,CAAC;AAEhD,OAAO,kBAAkB,CAAC;AAgC1B;;;;;;;;;GASG;AACH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;;;;;GASG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,KAAK,EACL,KAAK,EACL,SAAS,EACT,aAAa,EAAE,IAAI,GAAG,GAAG,EACzB,SAAS,GACO;IAChB,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACpC,MAAM,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,CAC1B,KAAC,IAAI,IAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAC,IAAI,EAAC,UAAU,QAAC,SAAS,EAAC,0BAA0B,GAAG,CACtF,CAAC,CAAC,CAAC,CACF,eAAM,SAAS,EAAC,0BAA0B,iBAAa,MAAM,kBAEtD,CACR,CAAC;IACF,OAAO,CACL,4BAAiB,KAAK,EAAE,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,SAAS,CAAC,YAC/D,aAAI,SAAS,EAAC,qBAAqB,YAChC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAC1B,cAAkB,SAAS,EAAC,qBAAqB,aAC9C,KAAK,GAAG,CAAC,IAAI,OAAO,EACpB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CACX,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,SAAS,EAAC,qBAAqB,YACnD,IAAI,CAAC,KAAK,GACN,CACR,CAAC,CAAC,CAAC,CACF,eAAM,SAAS,EAAC,qBAAqB,YAAE,IAAI,CAAC,KAAK,GAAQ,CAC1D,KARM,IAAI,CAAC,EAAE,CASX,CACN,CAAC,GACC,GACD,CACP,CAAC;AACJ,CAAC","sourcesContent":["import type { ElementType, ReactNode } from 'react';\nimport { cx } from '../cx';\nimport { Icon, type IconSource } from '../icon';\nimport type { LinkComponentProps } from '../link-component';\nimport './breadcrumb.css';\n\n/** One ancestor in the trail. */\nexport interface BreadcrumbItem {\n /** Stable key. */\n id: string;\n /** What the ancestor is called. A node, so a product can pass a richer label (a category's colour mark, say). */\n label: ReactNode;\n /** Makes the item a link to the ancestor. */\n href?: string;\n}\n\n/** What the link component receives; the props every `linkComponent` takes. */\nexport type BreadcrumbLinkProps = LinkComponentProps;\n\nexport interface BreadcrumbProps {\n /** The ancestors, outermost first. Renders nothing when empty. */\n items: BreadcrumbItem[];\n /**\n * The trail's accessible name: its navigation landmark's. Required, since a\n * list of rows each with a trail would otherwise repeat one landmark name;\n * name it after what it locates (\"Where Book the physio lives\").\n */\n label: string;\n /** Glyph between items, supplied by the product. Must point RIGHT in a left-to-right layout. Falls back to \"/\". */\n separator?: IconSource;\n /** Renders each link, so a product passes its router's link. Defaults to `<a>`. */\n linkComponent?: ElementType<BreadcrumbLinkProps>;\n /** Extra class names on the `<nav>`. */\n className?: string;\n}\n\n/**\n * Where something lives: its ancestors, outermost first, each a link when it\n * has a place of its own. Above a page title, or above a list row's title\n * when the row is filed in a hierarchy.\n *\n * @remarks\n * The trail lists ancestors only — the thing itself is the heading beside it —\n * so no item carries `aria-current`. The separators are decorative; a screen\n * reader hears a list of links in a navigation landmark.\n */\nexport function Breadcrumb({\n items,\n label,\n separator,\n linkComponent: Link = 'a',\n className,\n}: BreadcrumbProps) {\n if (items.length === 0) return null;\n const divider = separator ? (\n <Icon source={separator} size=\"sm\" decorative className=\"ds-breadcrumb__separator\" />\n ) : (\n <span className=\"ds-breadcrumb__separator\" aria-hidden=\"true\">\n /\n </span>\n );\n return (\n <nav aria-label={label} className={cx('ds-breadcrumb', className)}>\n <ol className=\"ds-breadcrumb__list\">\n {items.map((item, index) => (\n <li key={item.id} className=\"ds-breadcrumb__item\">\n {index > 0 && divider}\n {item.href ? (\n <Link href={item.href} className=\"ds-breadcrumb__link\">\n {item.label}\n </Link>\n ) : (\n <span className=\"ds-breadcrumb__text\">{item.label}</span>\n )}\n </li>\n ))}\n </ol>\n </nav>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/breadcrumb/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/breadcrumb/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export type { BreadcrumbItem, BreadcrumbLinkProps, BreadcrumbProps } from './breadcrumb';\nexport { Breadcrumb } from './breadcrumb';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/button/button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAEL,YAAY,EACZ,QAAQ,EACR,cAAc,GAGf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;AACrD,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AA8E3B,SAAS,aAAa,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAsB;IACzF,OAAO,CACL,8BACG,OAAO,IAAI,eAAM,SAAS,EAAC,oBAAoB,iBAAa,MAAM,GAAG,EACrE,WAAW,IAAI,CACd,KAAC,IAAI,IACH,MAAM,EAAE,WAAW,EACnB,IAAI,EAAC,IAAI,EACT,UAAU,QACV,SAAS,EAAC,0CAA0C,GACpD,CACH,EACD,eAAM,SAAS,EAAC,kBAAkB,YAAE,QAAQ,GAAQ,EACnD,YAAY,IAAI,CACf,KAAC,IAAI,IACH,MAAM,EAAE,YAAY,EACpB,IAAI,EAAC,IAAI,EACT,UAAU,QACV,SAAS,EAAC,2CAA2C,GACrD,CACH,IACA,CACJ,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CACjB,EAAE,OAAO,GAAG,SAAS,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,GAAG,KAAK,EA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MAAM,IACT,QAAQ,EAAE,QAAQ,IAAI,OAAO,EAC7B,SAAS,EAAE,EAAE,CACX,UAAU,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,SAAS,CAAC,EAC1D,OAAO,IAAI,oBAAoB,CAChC,KACG,KAAK,YAET,KAAC,aAAa,IAAC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,YAClF,QAAQ,GACK,GACL,CACd,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,MAAM,CAAC,KAAkB;IACvC,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAC,aAAa,OAAK,KAAK,GAAI,CAAC,CAAC,CAAC,KAAC,cAAc,OAAK,KAAK,GAAI,CAAC;AACtF,CAAC","sourcesContent":["import { ark } from '@ark-ui/react/factory';\nimport {\n type ComponentProps,\n cloneElement,\n Fragment,\n isValidElement,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { Icon, type IconSource } from '../icon/icon';\nimport './button.css';\nimport { cx } from '../cx';\n\nexport type ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'danger';\nexport type ButtonSize = 'sm' | 'md' | 'lg';\n\ninterface ButtonOwnProps {\n /** Visual style variant. */\n variant?: ButtonVariant;\n /** Size preset. */\n size?: ButtonSize;\n /**\n * Decorative icon rendered before the label.\n *\n * The icon sits beside text, so it is always the `sm` step of the icon\n * scale whatever the button size, and it inherits the button's text\n * color via `currentColor`. The icon is\n * always rendered as decorative — the accessible name comes from the\n * button's children.\n */\n leadingIcon?: IconSource;\n /**\n * Decorative icon rendered after the label. Same rendering contract as\n * {@link ButtonOwnProps.leadingIcon}.\n */\n trailingIcon?: IconSource;\n /** Whether the button takes the whole width of its row: a form's submit, a card's one action. */\n fullWidth?: boolean;\n /**\n * Where the label sits when the button is wider than its content: centred\n * by default, or at the start, with a trailing icon kept at the end, for a\n * trigger that reads as a field (a picker). Inline rather than a named\n * union: `check:variant-parity` would ask the native Button, which has no\n * label alignment, to export the same name.\n */\n align?: 'center' | 'start';\n}\n\ntype ArkButtonProps = Omit<ComponentProps<typeof ark.button>, 'asChild'>;\n\ninterface ButtonAsButtonProps extends ButtonOwnProps, ArkButtonProps {\n asChild?: false;\n /** Show loading spinner and disable interaction. */\n loading?: boolean;\n}\n\n/**\n * With `asChild` the child is the control, so everything that belongs to the\n * control goes on the child: `href`, handlers, `ref`, ARIA. Button adds its\n * look and nothing else, which is why no other prop is accepted here.\n *\n * A link has no disabled state: `disabled` is not an attribute of `<a>`, and\n * an anchor with an `href` stays reachable and clickable whatever it looks\n * like. So neither `disabled` nor `loading` exists. Render a `Button`, or no\n * control at all, when the destination is unavailable.\n */\ninterface ButtonAsChildProps extends ButtonOwnProps {\n /**\n * Render the single child element instead of a `<button>`, styled as this\n * button.\n */\n asChild: true;\n /**\n * The one element rendered as the control. Its own children become the\n * label. A component works if it passes `className` and `children` on to\n * the element it renders, as a router's link does.\n */\n children: ReactElement<{ className?: string; children?: ReactNode }>;\n /** Extra class names appended after the `ds-button` modifiers. */\n className?: string;\n}\n\nexport type ButtonProps = ButtonAsButtonProps | ButtonAsChildProps;\n\ninterface ButtonContentProps extends Pick<ButtonOwnProps, 'leadingIcon' | 'trailingIcon'> {\n loading: boolean;\n children: ReactNode;\n}\n\nfunction ButtonContent({ loading, leadingIcon, trailingIcon, children }: ButtonContentProps) {\n return (\n <>\n {loading && <span className=\"ds-button__spinner\" aria-hidden=\"true\" />}\n {leadingIcon && (\n <Icon\n source={leadingIcon}\n size=\"sm\"\n decorative\n className=\"ds-button__icon ds-button__icon--leading\"\n />\n )}\n <span className=\"ds-button__label\">{children}</span>\n {trailingIcon && (\n <Icon\n source={trailingIcon}\n size=\"sm\"\n decorative\n className=\"ds-button__icon ds-button__icon--trailing\"\n />\n )}\n </>\n );\n}\n\nfunction classesFor(\n { variant = 'primary', size = 'md', fullWidth = false, align = 'center' }: ButtonOwnProps,\n className?: string,\n) {\n return cx(\n 'ds-button',\n `ds-button--${variant}`,\n `ds-button--${size}`,\n fullWidth && 'ds-button--full-width',\n align !== 'center' && `ds-button--align-${align}`,\n className,\n );\n}\n\nfunction ButtonAsChild({\n variant,\n size,\n fullWidth,\n align,\n leadingIcon,\n trailingIcon,\n className,\n children,\n}: ButtonAsChildProps) {\n if (!isValidElement(children) || children.type === Fragment) {\n throw new Error(\n 'Button asChild needs exactly one element as its child, such as <a> or a router link.',\n );\n }\n\n const content = (\n <ButtonContent loading={false} leadingIcon={leadingIcon} trailingIcon={trailingIcon}>\n {children.props.children}\n </ButtonContent>\n );\n\n return cloneElement(\n children,\n {\n className: cx(\n classesFor({ variant, size, fullWidth, align }, className),\n children.props.className,\n ),\n },\n content,\n );\n}\n\nfunction ButtonAsButton({\n variant,\n size,\n fullWidth,\n align,\n loading = false,\n disabled,\n leadingIcon,\n trailingIcon,\n className,\n children,\n ...props\n}: ButtonAsButtonProps) {\n return (\n <ark.button\n disabled={disabled || loading}\n className={cx(\n classesFor({ variant, size, fullWidth, align }, className),\n loading && 'ds-button--loading',\n )}\n {...props}\n >\n <ButtonContent loading={loading} leadingIcon={leadingIcon} trailingIcon={trailingIcon}>\n {children}\n </ButtonContent>\n </ark.button>\n );\n}\n\n/**\n * Shared base button for the Manakind design system.\n *\n * Built on Ark UI for keyboard navigation, focus management, and disabled\n * state handling. Styled exclusively against the `--ds-button-*` token\n * contract; the consuming product is responsible for providing those values\n * via its tokens package (e.g. `@manakind/manuia-tokens/css/theme`).\n *\n * For an icon-only button (no visible label), use `IconButton` instead —\n * it enforces an `aria-label` at the type level.\n *\n * For an action that navigates, pass `asChild` and a link as the only child.\n * The link is what renders, so it keeps what a link does: open in a new tab,\n * copy its address, the router's prefetch. Its `href`, handlers and `ref`\n * stay on the link.\n *\n * ```tsx\n * <Button asChild leadingIcon={PlusCircle}>\n * <a href=\"/goals/new\">Add Goal</a>\n * </Button>\n * ```\n */\nexport function Button(props: ButtonProps) {\n return props.asChild ? <ButtonAsChild {...props} /> : <ButtonAsButton {...props} />;\n}\n"]}
|
|
@@ -3,7 +3,7 @@ import type { ComponentProps } from 'react';
|
|
|
3
3
|
import { type IconSource } from '../icon/icon';
|
|
4
4
|
import type { ButtonSize, ButtonVariant } from './button';
|
|
5
5
|
import './button.css';
|
|
6
|
-
export interface IconButtonProps extends Omit<ComponentProps<typeof ark.button>, 'children' | 'aria-label' | 'asChild'> {
|
|
6
|
+
export interface IconButtonProps extends Omit<ComponentProps<typeof ark.button>, 'children' | 'aria-label' | 'asChild' | 'title'> {
|
|
7
7
|
/** Decorative icon rendered inside the button. */
|
|
8
8
|
icon: IconSource;
|
|
9
9
|
/**
|
|
@@ -22,6 +22,13 @@ export interface IconButtonProps extends Omit<ComponentProps<typeof ark.button>,
|
|
|
22
22
|
size?: ButtonSize;
|
|
23
23
|
/** Show loading spinner and disable interaction. */
|
|
24
24
|
loading?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* The caption shown on hover and keyboard focus. Defaults to `aria-label`;
|
|
27
|
+
* pass a shorter one when the label carries the item's name for a screen
|
|
28
|
+
* reader ("Edit Run 10k") and the caption only needs the verb ("Edit").
|
|
29
|
+
* There is no `title`: the browser's own caption would show beside this one.
|
|
30
|
+
*/
|
|
31
|
+
tooltip?: string;
|
|
25
32
|
}
|
|
26
33
|
/**
|
|
27
34
|
* Square, icon-only button for the Manakind design system.
|
|
@@ -30,7 +37,8 @@ export interface IconButtonProps extends Omit<ComponentProps<typeof ark.button>,
|
|
|
30
37
|
* focus ring, disabled + loading behavior) by reusing the `ds-button`
|
|
31
38
|
* class plus a `ds-button--icon-only` modifier. The only API difference
|
|
32
39
|
* is that `aria-label` is required at the type level — an icon-only
|
|
33
|
-
* button has no visible text to derive an accessible name from
|
|
40
|
+
* button has no visible text to derive an accessible name from — and that
|
|
41
|
+
* it shows that name as a tooltip, since the glyph alone may not say it.
|
|
34
42
|
*/
|
|
35
|
-
export declare function IconButton({ icon, variant, size, loading, disabled, className, ...props }: IconButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
export declare function IconButton({ icon, variant, size, loading, disabled, className, tooltip, ...props }: IconButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
36
44
|
//# sourceMappingURL=icon-button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../src/button/icon-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../src/button/icon-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,cAAc,CAAC;AAGtB,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,YAAY,GAAG,SAAS,GAAG,OAAO,CAAC;IAChG,kDAAkD;IAClD,IAAI,EAAE,UAAU,CAAC;IACjB;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,oDAAoD;IACpD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,OAAmB,EACnB,IAAW,EACX,OAAe,EACf,QAAQ,EACR,SAAS,EACT,OAAO,EACP,GAAG,KAAK,EACT,EAAE,eAAe,2CAoBjB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ark } from '@ark-ui/react/factory';
|
|
3
3
|
import { Icon } from '../icon/icon';
|
|
4
|
+
import { Tooltip } from '../tooltip/tooltip';
|
|
4
5
|
import './button.css';
|
|
5
6
|
import { cx } from '../cx';
|
|
6
7
|
/**
|
|
@@ -10,9 +11,10 @@ import { cx } from '../cx';
|
|
|
10
11
|
* focus ring, disabled + loading behavior) by reusing the `ds-button`
|
|
11
12
|
* class plus a `ds-button--icon-only` modifier. The only API difference
|
|
12
13
|
* is that `aria-label` is required at the type level — an icon-only
|
|
13
|
-
* button has no visible text to derive an accessible name from
|
|
14
|
+
* button has no visible text to derive an accessible name from — and that
|
|
15
|
+
* it shows that name as a tooltip, since the glyph alone may not say it.
|
|
14
16
|
*/
|
|
15
|
-
export function IconButton({ icon, variant = 'primary', size = 'md', loading = false, disabled, className, ...props }) {
|
|
16
|
-
return (_jsxs(ark.button, { disabled: disabled || loading, className: cx('ds-button', 'ds-button--icon-only', `ds-button--${variant}`, `ds-button--${size}`, loading && 'ds-button--loading', className), ...props, children: [loading && _jsx("span", { className: "ds-button__spinner", "aria-hidden": "true" }), _jsx(Icon, { source: icon, size: size, decorative: true, className: "ds-button__icon" })] }));
|
|
17
|
+
export function IconButton({ icon, variant = 'primary', size = 'md', loading = false, disabled, className, tooltip, ...props }) {
|
|
18
|
+
return (_jsx(Tooltip, { content: tooltip ?? props['aria-label'], kind: "label", children: _jsxs(ark.button, { disabled: disabled || loading, className: cx('ds-button', 'ds-button--icon-only', `ds-button--${variant}`, `ds-button--${size}`, loading && 'ds-button--loading', className), ...props, children: [loading && _jsx("span", { className: "ds-button__spinner", "aria-hidden": "true" }), _jsx(Icon, { source: icon, size: size, decorative: true, className: "ds-button__icon" })] }) }));
|
|
17
19
|
}
|
|
18
20
|
//# sourceMappingURL=icon-button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-button.js","sourceRoot":"","sources":["../../src/button/icon-button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"icon-button.js","sourceRoot":"","sources":["../../src/button/icon-button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AA+B3B;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,IAAI,EACJ,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,IAAI,EACX,OAAO,GAAG,KAAK,EACf,QAAQ,EACR,SAAS,EACT,OAAO,EACP,GAAG,KAAK,EACQ;IAChB,OAAO,CACL,KAAC,OAAO,IAAC,OAAO,EAAE,OAAO,IAAI,KAAK,CAAC,YAAY,CAAC,EAAE,IAAI,EAAC,OAAO,YAC5D,MAAC,GAAG,CAAC,MAAM,IACT,QAAQ,EAAE,QAAQ,IAAI,OAAO,EAC7B,SAAS,EAAE,EAAE,CACX,WAAW,EACX,sBAAsB,EACtB,cAAc,OAAO,EAAE,EACvB,cAAc,IAAI,EAAE,EACpB,OAAO,IAAI,oBAAoB,EAC/B,SAAS,CACV,KACG,KAAK,aAER,OAAO,IAAI,eAAM,SAAS,EAAC,oBAAoB,iBAAa,MAAM,GAAG,EACtE,KAAC,IAAI,IAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,QAAC,SAAS,EAAC,iBAAiB,GAAG,IAC9D,GACL,CACX,CAAC;AACJ,CAAC","sourcesContent":["import { ark } from '@ark-ui/react/factory';\nimport type { ComponentProps } from 'react';\nimport { Icon, type IconSource } from '../icon/icon';\nimport { Tooltip } from '../tooltip/tooltip';\nimport type { ButtonSize, ButtonVariant } from './button';\nimport './button.css';\nimport { cx } from '../cx';\n\nexport interface IconButtonProps\n extends Omit<ComponentProps<typeof ark.button>, 'children' | 'aria-label' | 'asChild' | 'title'> {\n /** Decorative icon rendered inside the button. */\n icon: IconSource;\n /**\n * Accessible label announced by assistive tech. Required because the\n * button has no visible text content to derive a name from.\n */\n 'aria-label': string;\n /** Visual style variant. Shared with {@link Button}. */\n variant?: ButtonVariant;\n /**\n * Size preset. The icon is the label, so it takes the icon scale's step of\n * the same name (16 / 24 / 32px) and the circle keeps the same inset around\n * it (32 / 40 / 48px). The circle is taller than a text `Button` of the\n * same size from `md` up.\n */\n size?: ButtonSize;\n /** Show loading spinner and disable interaction. */\n loading?: boolean;\n /**\n * The caption shown on hover and keyboard focus. Defaults to `aria-label`;\n * pass a shorter one when the label carries the item's name for a screen\n * reader (\"Edit Run 10k\") and the caption only needs the verb (\"Edit\").\n * There is no `title`: the browser's own caption would show beside this one.\n */\n tooltip?: string;\n}\n\n/**\n * Square, icon-only button for the Manakind design system.\n *\n * Shares the full visual contract with `Button` (same variants, sizes,\n * focus ring, disabled + loading behavior) by reusing the `ds-button`\n * class plus a `ds-button--icon-only` modifier. The only API difference\n * is that `aria-label` is required at the type level — an icon-only\n * button has no visible text to derive an accessible name from — and that\n * it shows that name as a tooltip, since the glyph alone may not say it.\n */\nexport function IconButton({\n icon,\n variant = 'primary',\n size = 'md',\n loading = false,\n disabled,\n className,\n tooltip,\n ...props\n}: IconButtonProps) {\n return (\n <Tooltip content={tooltip ?? props['aria-label']} kind=\"label\">\n <ark.button\n disabled={disabled || loading}\n className={cx(\n 'ds-button',\n 'ds-button--icon-only',\n `ds-button--${variant}`,\n `ds-button--${size}`,\n loading && 'ds-button--loading',\n className,\n )}\n {...props}\n >\n {loading && <span className=\"ds-button__spinner\" aria-hidden=\"true\" />}\n <Icon source={icon} size={size} decorative className=\"ds-button__icon\" />\n </ark.button>\n </Tooltip>\n );\n}\n"]}
|
package/dist/button/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/button/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/button/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC","sourcesContent":["export type { ButtonProps, ButtonSize, ButtonVariant } from './button';\nexport { Button } from './button';\nexport type { IconButtonProps } from './icon-button';\nexport { IconButton } from './icon-button';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../src/calendar/calendar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,IAAI,aAAa,EAAkB,MAAM,2BAA2B,CAAC;AACxF,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,YA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} from '@internationalized/date';\nimport { useEffect, useRef, useState } from 'react';\nimport './calendar.css';\nimport { IconButton } from '../button/icon-button';\nimport { cx } from '../cx';\nimport { ChevronLeft, ChevronRight } from '../fallback-glyphs';\nimport type { IconSource } from '../icon/icon';\nimport { parseIsoDate } from '../iso-date';\n\n/**\n * A stretch of days. Both ends are ISO calendar dates, `YYYY-MM-DD`; `end`\n * is `null` while only the first day is chosen.\n */\nexport interface CalendarRange {\n start: string;\n end: string | null;\n}\n\n/** A day of the week as `Date#getDay()` counts them: 0 is Sunday, 1 is Monday. */\nexport type CalendarWeekday = 0 | 1 | 2 | 3 | 4 | 5 | 6;\n\ninterface CalendarCommonProps {\n /**\n * The calendar's name, saying which day is being chosen: \"Scheduled day\",\n * \"Target date\". A calendar has no label of its own, and the month heading\n * changes as the user pages.\n */\n 'aria-label': string;\n /**\n * BCP 47 tag that decides the month and weekday names and, unless\n * `startOfWeek` says otherwise, the first day of the week. Defaults to\n * `en-GB`: English names, Monday first. The products' own date format is\n * not involved; the grid shows day numbers only.\n */\n locale?: string;\n /** The first column, `0` for Sunday through `6` for Saturday. Defaults to the locale's. */\n startOfWeek?: CalendarWeekday;\n /**\n * The earliest day that can be chosen, `YYYY-MM-DD`. Earlier days are\n * shown but cannot be chosen; a value outside the window is still shown\n * as the value.\n */\n min?: string;\n /** The latest day that can be chosen, `YYYY-MM-DD`. */\n max?: string;\n /**\n * Any day of the month shown first when nothing is chosen yet,\n * `YYYY-MM-DD`. Defaults to the month of the chosen day, else this month.\n */\n defaultMonth?: string;\n /**\n * Moves focus to the chosen day (else the first day shown by\n * `defaultMonth`, else today) once the calendar is in the page. For a calendar opened in a popover, so\n * the arrow keys work at once and a screen reader lands on a day.\n */\n autoFocus?: boolean;\n /** Dims the calendar; nothing in it can be focused or chosen. */\n disabled?: boolean;\n /** Shows the days and the choice, pages freely, but lets nothing be chosen. */\n readOnly?: boolean;\n /**\n * Glyph for the \"previous month\" button. Defaults to a plain built-in\n * chevron so `@manakind/ui-core` renders on its own; products pass their\n * own icon set.\n */\n previousIcon?: IconSource;\n /** Glyph for the \"next month\" button. Same defaulting rule as {@link CalendarCommonProps.previousIcon}. */\n nextIcon?: IconSource;\n /** Extra class names appended after `ds-calendar`. */\n className?: string;\n}\n\ninterface CalendarSingleProps {\n /** One day at a time. The default. */\n selectionMode?: 'single';\n /** The chosen day, `YYYY-MM-DD`, or `null` for none. Leave undefined to let the calendar own it. */\n value?: string | null;\n /** The day chosen at first when uncontrolled, or `null` for none. */\n defaultValue?: string | null;\n /**\n * Fired with the ISO date of the day the user chose. Choosing the chosen\n * day again fires nothing, and the calendar never clears: a product that\n * lets the user unschedule does it with a control of its own.\n */\n onValueChange?: (value: string) => void;\n}\n\ninterface CalendarRangeProps {\n /**\n * A first and a last day. The first click chooses the first day and fires\n * with `end: null`; the second click chooses the last day, in either\n * order, and fires with both; a third click starts a new range.\n */\n selectionMode: 'range';\n /** The chosen range, or `null` for none. Leave undefined to let the calendar own it. */\n value?: CalendarRange | null;\n /** The range chosen at first when uncontrolled, or `null` for none. */\n defaultValue?: CalendarRange | null;\n /** Fired with the range so far: `end` is `null` after the first click of a new range. */\n onValueChange?: (value: CalendarRange) => void;\n}\n\ntype CalendarSelection = CalendarSingleProps | CalendarRangeProps;\n\nexport type CalendarProps = CalendarCommonProps & CalendarSelection;\n\nconst parseIso = (iso: string, prop: string): DateValue => parseIsoDate(iso, `Calendar: ${prop}`);\n\nconst parseOptional = (iso: string | undefined, prop: string): DateValue | undefined =>\n iso === undefined ? undefined : parseIso(iso, prop);\n\n/*\n * Zag keeps every selection as a list of dates: one for a day, up to two\n * for a range. The product's typed shape is folded into that list on the\n * way in and rebuilt on the way out.\n */\nfunction toDateValues(\n selection: CalendarSelection,\n prop: 'value' | 'defaultValue',\n): DateValue[] | undefined {\n const given = selection[prop];\n if (given === undefined) return undefined;\n if (given === null) return [];\n if (typeof given === 'string') return [parseIso(given, prop)];\n const dates = [parseIso(given.start, `${prop}.start`)];\n if (given.end !== null) dates.push(parseIso(given.end, `${prop}.end`));\n return dates;\n}\n\n/*\n * Zag's list can be sparse: a range cleared from outside between its two\n * clicks keeps Zag waiting for an end date, and the next click lands at\n * index 1 of an empty list. The dates that are there are the selection.\n */\nfunction report(selection: CalendarSelection, dates: DateValue[]): void {\n const [start, end] = dates.filter((date) => date !== undefined);\n if (!start) return;\n if (selection.selectionMode === 'range') {\n selection.onValueChange?.({ start: start.toString(), end: end?.toString() ?? null });\n return;\n }\n selection.onValueChange?.(start.toString());\n}\n\n/*\n * The day Zag's keyboard focus and the shown month follow. Zag moves it on\n * its own events only, so a value the parent changes to another month\n * would leave the grid on the old one: the calendar owns it, and moves it\n * to the chosen day whenever the parent chooses a new one.\n */\nfunction useFocusedDay(chosen: DateValue | undefined, fallback: DateValue | undefined) {\n const chosenKey = chosen?.toString();\n const [focused, setFocused] = useState(() => ({\n key: chosenKey,\n day: chosen ?? fallback ?? today(getLocalTimeZone()),\n }));\n if (chosenKey !== focused.key) {\n setFocused({ key: chosenKey, day: chosen ?? focused.day });\n }\n const setDay = (day: DateValue) => setFocused((state) => ({ ...state, day }));\n return [focused.day, setDay] as const;\n}\n\n/**\n * A month of days to choose from, built on Ark UI's DatePicker.\n *\n * The grid shows one month at a time with the weekdays across the top and\n * a button pair to turn the page; the days of the neighbouring months fill\n * the first and last rows, and every month has six rows, so the calendar\n * keeps its height as the user pages. One day is chosen at a time, or a\n * first and a last day with `selectionMode=\"range\"`. The value in and out is\n * an ISO calendar date, `YYYY-MM-DD`, as `DateInput` gives: a string a form\n * library and a database both keep as is, with no time zone to get wrong.\n *\n * It is the grid alone. A product puts it in a `Popover` behind a button\n * that shows the choice, or in the page, and gives it `aria-label`; the\n * labels the grid speaks (\"Choose Wednesday 12 June 2024\", \"Previous month\")\n * are English, as Ark's are.\n *\n * ```tsx\n * <Calendar aria-label=\"Scheduled day\" value={day} onValueChange={setDay} autoFocus />\n * ```\n */\nexport function Calendar({\n 'aria-label': ariaLabel,\n locale = 'en-GB',\n startOfWeek,\n min,\n max,\n defaultMonth,\n autoFocus = false,\n disabled,\n readOnly,\n previousIcon = ChevronLeft,\n nextIcon = ChevronRight,\n className,\n ...selection\n}: CalendarProps) {\n const rootRef = useRef<HTMLDivElement>(null);\n const controlledDates = toDateValues(selection, 'value');\n const initialDates = toDateValues(selection, 'defaultValue');\n const [focusedDay, setFocusedDay] = useFocusedDay(\n controlledDates?.[0] ?? initialDates?.[0],\n parseOptional(defaultMonth, 'defaultMonth'),\n );\n const minDate = parseOptional(min, 'min');\n const maxDate = parseOptional(max, 'max');\n\n /*\n * Passed as unavailable days rather than Zag's own `min`/`max`, which clamp\n * a value outside them to the nearest allowed day and show that day as\n * chosen while the parent holds another. Unavailable days are disabled and\n * cannot be chosen, and a value outside the window stays the value.\n */\n const isOutsideWindow = (date: DateValue) =>\n (minDate !== undefined && date.compare(minDate) < 0) ||\n (maxDate !== undefined && date.compare(maxDate) > 0);\n\n /*\n * Zag gives the focused day `tabindex=\"0\"` and every other day `-1`; the\n * one day in the tab order is the one to land on. An effect, because the\n * focus is the browser's.\n */\n useEffect(() => {\n if (!autoFocus) return;\n rootRef.current\n ?.querySelector<HTMLElement>('[data-part=\"table-cell-trigger\"][tabindex=\"0\"]')\n ?.focus({ preventScroll: true });\n }, [autoFocus]);\n\n return (\n <ArkDatePicker.Root\n ref={rootRef}\n className={cx('ds-calendar', className)}\n inline\n closeOnSelect={false}\n fixedWeeks\n outsideDaySelectable\n selectionMode={selection.selectionMode ?? 'single'}\n value={controlledDates}\n defaultValue={initialDates}\n onValueChange={(details) => report(selection, details.value)}\n focusedValue={focusedDay}\n onFocusChange={(details) => setFocusedDay(details.focusedValue)}\n isDateUnavailable={minDate || maxDate ? isOutsideWindow : undefined}\n locale={locale}\n timeZone={getLocalTimeZone()}\n startOfWeek={startOfWeek}\n disabled={disabled}\n readOnly={readOnly}\n >\n <ArkDatePicker.Content\n className=\"ds-calendar__content\"\n aria-label={ariaLabel}\n aria-disabled={disabled || undefined}\n >\n <ArkDatePicker.View view=\"day\">\n <ArkDatePicker.Context>\n {(api) => (\n <>\n <ArkDatePicker.ViewControl className=\"ds-calendar__header\">\n <ArkDatePicker.PrevTrigger asChild>\n <IconButton\n variant=\"tertiary\"\n size=\"sm\"\n icon={previousIcon}\n aria-label=\"Previous month\"\n />\n </ArkDatePicker.PrevTrigger>\n <ArkDatePicker.RangeText className=\"ds-calendar__heading\" aria-live=\"polite\" />\n <ArkDatePicker.NextTrigger asChild>\n <IconButton\n variant=\"tertiary\"\n size=\"sm\"\n icon={nextIcon}\n aria-label=\"Next month\"\n />\n </ArkDatePicker.NextTrigger>\n </ArkDatePicker.ViewControl>\n <ArkDatePicker.Table className=\"ds-calendar__table\">\n <ArkDatePicker.TableHead>\n <ArkDatePicker.TableRow>\n {api.weekDays.map((weekDay) => (\n <ArkDatePicker.TableHeader\n key={weekDay.value.toString()}\n className=\"ds-calendar__weekday\"\n >\n {weekDay.short}\n </ArkDatePicker.TableHeader>\n ))}\n </ArkDatePicker.TableRow>\n </ArkDatePicker.TableHead>\n <ArkDatePicker.TableBody>\n {api.weeks.map((week) => (\n <ArkDatePicker.TableRow key={week[0]?.toString()}>\n {week.map((day) => (\n <ArkDatePicker.TableCell\n key={day.toString()}\n value={day}\n className=\"ds-calendar__cell\"\n >\n <ArkDatePicker.TableCellTrigger className=\"ds-calendar__day\">\n <span className=\"ds-calendar__day-fill\">{day.day}</span>\n </ArkDatePicker.TableCellTrigger>\n </ArkDatePicker.TableCell>\n ))}\n </ArkDatePicker.TableRow>\n ))}\n </ArkDatePicker.TableBody>\n </ArkDatePicker.Table>\n </>\n )}\n </ArkDatePicker.Context>\n </ArkDatePicker.View>\n </ArkDatePicker.Content>\n </ArkDatePicker.Root>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/calendar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,GAIT,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/calendar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,GAIT,MAAM,YAAY,CAAC","sourcesContent":["export {\n Calendar,\n type CalendarProps,\n type CalendarRange,\n type CalendarWeekday,\n} from './calendar';\n"]}
|
package/dist/card/card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.js","sourceRoot":"","sources":["../../src/card/card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,YAAY,CAAC;AACpB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAmB3B;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,IAAI,CAAC,EAAE,WAAW,GAAG,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAa;IACpF,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IACN,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,WAAW,IAAI,sBAAsB,EAAE,SAAS,CAAC,KACtE,KAAK,sBACS,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,YAE7C,QAAQ,GACD,CACX,CAAC;AACJ,CAAC;AAcD,qEAAqE;AACrE,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,GAAG,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAmB;IAC5F,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IACN,SAAS,EAAE,EAAE,CAAC,iBAAiB,EAAE,KAAK,KAAK,QAAQ,IAAI,yBAAyB,EAAE,SAAS,CAAC,KACxF,KAAK,YAER,QAAQ,GACD,CACX,CAAC;AACJ,CAAC;AAyBD,4EAA4E;AAC5E,MAAM,UAAU,SAAS,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAkB;I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,KAAK,YAC7D,QAAQ,GACC,CACb,CAAC;AACJ,CAAC;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAiB;IACvE,OAAO,CACL,KAAC,GAAG,CAAC,CAAC,IAAC,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,SAAS,CAAC,KAAM,KAAK,YACxD,QAAQ,GACH,CACT,CAAC;AACJ,CAAC;AAID,yEAAyE;AACzE,MAAM,UAAU,eAAe,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAwB;IACrF,OAAO,CACL,KAAC,GAAG,CAAC,CAAC,IAAC,SAAS,EAAE,EAAE,CAAC,sBAAsB,EAAE,SAAS,CAAC,KAAM,KAAK,YAC/D,QAAQ,GACH,CACT,CAAC;AACJ,CAAC;AAID,kCAAkC;AAClC,MAAM,UAAU,WAAW,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAoB;IAC7E,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IAAC,SAAS,EAAE,EAAE,CAAC,kBAAkB,EAAE,SAAS,CAAC,KAAM,KAAK,YAC7D,QAAQ,GACD,CACX,CAAC;AACJ,CAAC;AAID,+DAA+D;AAC/D,MAAM,UAAU,UAAU,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAmB;IAC3E,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IAAC,SAAS,EAAE,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC,KAAM,KAAK,YAC5D,QAAQ,GACD,CACX,CAAC;AACJ,CAAC","sourcesContent":["import { ark } from '@ark-ui/react/factory';\nimport type { ComponentProps } from 'react';\nimport './card.css';\nimport { cx } from '../cx';\n\nexport interface CardProps extends ComponentProps<typeof ark.div> {\n /**\n * Opt into hover and focus affordances for cards that act as a single\n * click target (a link wrapping the whole card, for example).\n *\n * This only applies styling. The consumer is still responsible for making\n * the card actually operable — put a {@link CardLink} in its title, wrap it\n * in a link or button, or supply the appropriate role and key handling. A\n * card is not interactive by virtue of this prop.\n *\n * The component reflects this state as `[data-interactive]`, a stable hook\n * for compositions that need to extend the interactive treatment without\n * targeting ui-core's internal class names.\n */\n interactive?: boolean;\n}\n\n/**\n * Surface container for grouped content.\n *\n * A structural primitive, not an Ark UI behavioural component — cards have\n * no interaction model of their own. Styled exclusively against the\n * `--ds-card-*` token contract.\n *\n * Compose with {@link CardHeader}, {@link CardTitle}, {@link CardLink},\n * {@link CardDescription}, {@link CardContent}, and {@link CardFooter}. Each sub-part is optional and\n * carries only layout; none of them impose semantics beyond `CardTitle`,\n * which renders a real heading.\n *\n * The contract exposes no shadow token, so `Card` draws a border and no\n * elevation. Products that want raised surfaces add the shadow in their own\n * composition layer rather than through this component.\n */\nexport function Card({ interactive = false, className, children, ...props }: CardProps) {\n return (\n <ark.div\n className={cx('ds-card', interactive && 'ds-card--interactive', className)}\n {...props}\n data-interactive={interactive ? '' : undefined}\n >\n {children}\n </ark.div>\n );\n}\n\n/** Where a card header's parts sit: at the start, or centred. */\nexport type CardHeaderAlign = 'start' | 'center';\n\nexport interface CardHeaderProps extends ComponentProps<typeof ark.div> {\n /**\n * Where the title, description and anything else in the header sit:\n * at the start by default, or centred, for a card that is the page (a\n * sign-in card with its logo over the title).\n */\n align?: CardHeaderAlign;\n}\n\n/** Top region of a card. Stacks its children with the card's gap. */\nexport function CardHeader({ align = 'start', className, children, ...props }: CardHeaderProps) {\n return (\n <ark.div\n className={cx('ds-card__header', align === 'center' && 'ds-card__header--center', className)}\n {...props}\n >\n {children}\n </ark.div>\n );\n}\n\n/**\n * The heading levels {@link CardTitle} can render.\n *\n * Deliberately not `ElementType`: the implementation indexes the Ark factory,\n * whose proxy hands any key straight to `createElement` as a tag name. A\n * component reference is a valid `ElementType` but would be stringified into\n * its own source text and thrown as an invalid tag name at runtime, so the\n * type is narrowed to exactly what the implementation can render.\n */\nexport type CardHeadingTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n\nexport interface CardTitleProps extends ComponentProps<typeof ark.h3> {\n /**\n * Heading level to render. Defaults to `h3`.\n *\n * Pick the level that fits the surrounding document outline — a card in a\n * page section usually wants `h3`, but a card that is the page's primary\n * content may want `h2`. Never skip levels to get a particular size; size\n * comes from the token, not the tag.\n */\n as?: CardHeadingTag;\n}\n\n/** Accessible heading for a card. Renders `h3` unless `as` overrides it. */\nexport function CardTitle({ as, className, children, ...props }: CardTitleProps) {\n const Component = as ? ark[as] : ark.h3;\n return (\n <Component className={cx('ds-card__title', className)} {...props}>\n {children}\n </Component>\n );\n}\n\nexport type CardLinkProps = ComponentProps<typeof ark.a>;\n\n/**\n * The card's one destination: a link whose hit area stretches over the whole\n * card, so a click anywhere on it opens the destination while other controls\n * inside the card stay separately operable.\n *\n * Wrapping a card in a link can't do that: any button or menu inside the\n * link is interactive content nested in interactive content, which is invalid\n * HTML, gives an unpredictable tab order, and swallows the inner control's\n * clicks. Here the link wraps only the title text, so it is named by the title\n * and sits in the tab order once. A transparent `::after` stretches it over\n * the card.\n *\n * ```tsx\n * <Card interactive>\n * <CardTitle>\n * <CardLink href=\"/goals/123\">Run a half marathon</CardLink>\n * </CardTitle>\n * <button type=\"button\" className=\"raised\">…</button>\n * </Card>\n * ```\n *\n * - Pass `interactive` to the card for its hover affordance. The focus ring is\n * drawn on the card whenever this link has keyboard focus.\n * - Every other control in the card has to paint above the stretched area:\n * give it `position: relative` and `z-index: 1` (the `raised` stacking\n * layer) on your own class, or the link takes its clicks.\n * - Text under the stretched area can't be selected with a pointer drag.\n * Keep the card to content that is read rather than copied.\n * - Use one per card. A second one would cover the first.\n *\n * For a router's link, pass `asChild` and the link as the only child; it\n * receives this part's class and keeps its own `href` and behaviour:\n * `<CardLink asChild><Link href=\"/goals/123\">Run a half marathon</Link></CardLink>`.\n */\nexport function CardLink({ className, children, ...props }: CardLinkProps) {\n return (\n <ark.a className={cx('ds-card__link', className)} {...props}>\n {children}\n </ark.a>\n );\n}\n\nexport type CardDescriptionProps = ComponentProps<typeof ark.p>;\n\n/** Muted supporting copy, typically directly under {@link CardTitle}. */\nexport function CardDescription({ className, children, ...props }: CardDescriptionProps) {\n return (\n <ark.p className={cx('ds-card__description', className)} {...props}>\n {children}\n </ark.p>\n );\n}\n\nexport type CardContentProps = ComponentProps<typeof ark.div>;\n\n/** Main body region of a card. */\nexport function CardContent({ className, children, ...props }: CardContentProps) {\n return (\n <ark.div className={cx('ds-card__content', className)} {...props}>\n {children}\n </ark.div>\n );\n}\n\nexport type CardFooterProps = ComponentProps<typeof ark.div>;\n\n/** Bottom region of a card. Lays its children out in a row. */\nexport function CardFooter({ className, children, ...props }: CardFooterProps) {\n return (\n <ark.div className={cx('ds-card__footer', className)} {...props}>\n {children}\n </ark.div>\n );\n}\n"]}
|
package/dist/card/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/card/index.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,IAAI,EACJ,WAAW,EACX,eAAe,EACf,UAAU,EACV,UAAU,EACV,QAAQ,EACR,SAAS,GACV,MAAM,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/card/index.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,IAAI,EACJ,WAAW,EACX,eAAe,EACf,UAAU,EACV,UAAU,EACV,QAAQ,EACR,SAAS,GACV,MAAM,QAAQ,CAAC","sourcesContent":["export type {\n CardContentProps,\n CardDescriptionProps,\n CardFooterProps,\n CardHeaderAlign,\n CardHeaderProps,\n CardHeadingTag,\n CardLinkProps,\n CardProps,\n CardTitleProps,\n} from './card';\nexport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardLink,\n CardTitle,\n} from './card';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"centered-layout.js","sourceRoot":"","sources":["../../src/centered-layout/centered-layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,uBAAuB,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAQ3B;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,EAC7B,IAAI,GAAG,IAAI,EACX,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACY;IACpB,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IACN,SAAS,EAAE,EAAE,CAAC,oBAAoB,EAAE,uBAAuB,IAAI,EAAE,EAAE,SAAS,CAAC,KACzE,KAAK,YAER,QAAQ,GACD,CACX,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"centered-layout.js","sourceRoot":"","sources":["../../src/centered-layout/centered-layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,uBAAuB,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAQ3B;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,EAC7B,IAAI,GAAG,IAAI,EACX,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACY;IACpB,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IACN,SAAS,EAAE,EAAE,CAAC,oBAAoB,EAAE,uBAAuB,IAAI,EAAE,EAAE,SAAS,CAAC,KACzE,KAAK,YAER,QAAQ,GACD,CACX,CAAC;AACJ,CAAC","sourcesContent":["import { ark } from '@ark-ui/react/factory';\nimport type { ComponentProps } from 'react';\nimport './centered-layout.css';\nimport { cx } from '../cx';\nimport type { ContentWidth } from '../layout/layout';\n\nexport interface CenteredLayoutProps extends ComponentProps<typeof ark.div> {\n /** Where the centred column stops growing. Defaults to `md`, a card's width. */\n size?: Exclude<ContentWidth, 'xl'>;\n}\n\n/**\n * One column centred on the canvas, for the pages that stand outside the\n * app's shell: sign-in, a consent prompt, an error, a loading screen.\n *\n * Fills the viewport's height, paints the canvas colour, and centres its\n * children both ways, each no wider than `size`. There is no inner wrapper,\n * so `asChild` can make the page's `main` the layout itself.\n */\nexport function CenteredLayout({\n size = 'md',\n className,\n children,\n ...props\n}: CenteredLayoutProps) {\n return (\n <ark.div\n className={cx('ds-centered-layout', `ds-centered-layout--${size}`, className)}\n {...props}\n >\n {children}\n </ark.div>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/centered-layout/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/centered-layout/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["export type { CenteredLayoutProps } from './centered-layout';\nexport { CenteredLayout } from './centered-layout';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../src/checkbox/checkbox.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,IAAI,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAkB,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,gBAAgB,CAAC;AACxB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;AAiErD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,QAAQ,CAAC,EACvB,KAAK,EACL,OAAO,EACP,cAAc,EACd,eAAe,EACf,IAAI,GAAG,IAAI,EACX,QAAQ,EACR,OAA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J,CAAC","sourcesContent":["import { Checkbox as ArkCheckbox } from '@ark-ui/react/checkbox';\nimport { type ReactNode, useId, useRef } from 'react';\nimport './checkbox.css';\nimport { cx } from '../cx';\nimport { Check } from '../fallback-glyphs';\nimport { Icon, type IconSource } from '../icon/icon';\n\nexport type CheckboxSize = 'sm' | 'md' | 'lg';\n\n/**\n * A checkbox has to have a name. A visible `label` is the one to reach for:\n * the whole label is the click target. Expressed as a union so an unnamed\n * checkbox is a compile error rather than an axe finding, as `Switch` does.\n */\ntype CheckboxName =\n | {\n /** Visible label. The whole label is the click target. */\n label: ReactNode;\n /**\n * A different accessible name when the visible label alone would not\n * say what the control is. Keep the visible words in it, so a voice\n * user can still say what they see.\n */\n 'aria-label'?: string;\n }\n | {\n label?: undefined;\n /** Accessible name when no visible label fits, such as a row whose text already says what the checkbox is. */\n 'aria-label': string;\n };\n\nexport type CheckboxProps = CheckboxName & {\n /** Controlled checked state. Leave undefined to let the component own it. */\n checked?: boolean;\n /** Initial state when uncontrolled. */\n defaultChecked?: boolean;\n /** Fired with the new state whenever the user toggles the checkbox. */\n onCheckedChange?: (checked: boolean) => void;\n /** Control size and label type scale. */\n size?: CheckboxSize;\n /** Disable the control. It keeps its state and stops responding. */\n disabled?: boolean;\n /**\n * Marks the control invalid for assistive tech and styling (`data-invalid`).\n * Pair it with a message the control points at through `aria-describedby`;\n * a red border alone is not an accessible error.\n */\n invalid?: boolean;\n /** Id of the element that describes the control, such as an error message. */\n 'aria-describedby'?: string;\n /** Show the state without letting the user change it. */\n readOnly?: boolean;\n /** Marks the hidden input required for native form validation. */\n required?: boolean;\n /** Name for native form participation. */\n name?: string;\n /** Value submitted under `name` while checked. Defaults to `on`. */\n value?: string;\n /**\n * Glyph shown in the box while checked.\n *\n * Defaults to a plain built-in check so `@manakind/ui-core` installs and\n * renders on its own. Products override it with their own icon set, as\n * they do Select's `itemIndicator`.\n */\n indicator?: IconSource;\n /** Extra class names appended after the `ds-checkbox` modifiers. */\n className?: string;\n};\n\n/**\n * A choice that is saved with the form, built on Ark UI's Checkbox.\n *\n * Ark owns the behaviour: a hidden checkbox carries the state, the root is\n * the `<label>` that names it, and Space and pointer toggling come for free.\n * This wrapper contributes `ds-` classes, the `--ds-checkbox-*` bindings, a\n * flat prop API, and the check glyph.\n *\n * ```tsx\n * <Checkbox label=\"Health\" checked={chosen} onCheckedChange={setChosen} />\n * ```\n *\n * A checkbox is for a choice that is submitted later, alone or as one of\n * several that can all be on. A setting that takes effect at once is a\n * `Switch`; a choice between values of which exactly one applies is a\n * `Select`.\n */\nexport function Checkbox({\n label,\n checked,\n defaultChecked,\n onCheckedChange,\n size = 'md',\n disabled,\n invalid,\n readOnly,\n required,\n name,\n value,\n indicator = Check,\n className,\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedBy,\n}: CheckboxProps) {\n const inputRef = useRef<HTMLInputElement>(null);\n\n /*\n * Zag always names the hidden input by its label part's id, which would\n * outrank an `aria-label`. With both given, the visible label is plain\n * text instead, so that id resolves to nothing and the `aria-label` wins;\n * the root is still the `<label>`, so the text stays the click target.\n */\n\n /*\n * Ark hands a checkbox inside a Field the field's control and label ids,\n * so two checkboxes in one field would share an id and both be named by\n * the field's label. A checkbox names itself, so it keeps its own ids and\n * takes only the states from a field around it.\n */\n const ownId = useId();\n const ids = { hiddenInput: `${ownId}:input`, label: `${ownId}:label` };\n\n /*\n * Ark renders the hidden input uncontrolled and syncs it only when its own\n * state changes, so a controlled parent that declines a toggle would leave\n * the native input flipped while the box shows the old state. Restoring\n * the parent's value after Ark has read the input keeps the two agreeing,\n * as Switch does.\n */\n const handleCheckedChange = (details: { checked: boolean | 'indeterminate' }) => {\n onCheckedChange?.(details.checked === true);\n if (checked !== undefined && inputRef.current) inputRef.current.checked = checked;\n };\n\n return (\n <ArkCheckbox.Root\n ids={ids}\n className={cx('ds-checkbox', `ds-checkbox--${size}`, className)}\n checked={checked}\n defaultChecked={defaultChecked}\n onCheckedChange={handleCheckedChange}\n disabled={disabled}\n invalid={invalid}\n readOnly={readOnly}\n required={required}\n name={name}\n value={value}\n >\n <ArkCheckbox.Control className=\"ds-checkbox__control\">\n <ArkCheckbox.Indicator className=\"ds-checkbox__indicator\">\n <Icon source={indicator} size=\"sm\" decorative />\n </ArkCheckbox.Indicator>\n </ArkCheckbox.Control>\n {label &&\n (ariaLabel ? (\n <span className=\"ds-checkbox__label\">{label}</span>\n ) : (\n <ArkCheckbox.Label className=\"ds-checkbox__label\">{label}</ArkCheckbox.Label>\n ))}\n <ArkCheckbox.HiddenInput\n ref={inputRef}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedBy}\n aria-readonly={readOnly || undefined}\n />\n </ArkCheckbox.Root>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/checkbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAyC,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/checkbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAyC,MAAM,YAAY,CAAC","sourcesContent":["export { Checkbox, type CheckboxProps, type CheckboxSize } from './checkbox';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../src/combobox/combobox.tsx"],"names":[],"mappings":"AAGA,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,GAAG,EAST,MAAM,OAAO,CAAC;AAKf,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../src/combobox/combobox.tsx"],"names":[],"mappings":"AAGA,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,GAAG,EAST,MAAM,OAAO,CAAC;AAKf,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAGrD,OAAO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ClB,2DAA2D;IAC3D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oDAAoD;IACpD,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;OAIG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,qEAAqE;IACrE,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,kEAAkE;IAClE,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,wFAAwF;IACxF,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,qCAAqC;IACrC,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gGAAgG;IAChG,QAAQ,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CAClC;AAYD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,UAAU,EACV,kBAAkB,EAClB,QAAQ,EACR,KAAK,EACL,YAAY,EAAE,SAAS,EACvB,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,MAAM,EACN,OAAa,EACb,UAAkB,EAClB,IAAW,EACX,QAAQ,EACR,OAAO,EACP,SAAS,EACT,QAAQ,GACT,EAAE,aAAa,2CA+Uf"}
|
|
@@ -9,6 +9,7 @@ import { Cross, Pin } from '../fallback-glyphs';
|
|
|
9
9
|
import { groupItems } from '../group-items';
|
|
10
10
|
import { Icon } from '../icon/icon';
|
|
11
11
|
import { PortalContainerContext } from '../portal-container';
|
|
12
|
+
import { Tooltip } from '../tooltip/tooltip';
|
|
12
13
|
import '../visually-hidden/visually-hidden.css';
|
|
13
14
|
import './combobox.css';
|
|
14
15
|
// The header's own controls, which a press may focus.
|
|
@@ -331,9 +332,9 @@ function GridRow({ row, pinIcon }) {
|
|
|
331
332
|
return (_jsxs("tr", { id: row.rowId, className: "ds-combobox__item", ...rowState(row), children: [_jsx(GridCell, { id: row.itemCellId, className: "ds-combobox__cell", "aria-disabled": item.disabled, children: _jsx(ItemText, { item: item }) }), _jsx(GridCell, { id: row.facetCellId, className: "ds-combobox__facet", children: item.facet && _jsx(FacetCell, { facet: item.facet, row: row, pinIcon: pinIcon }) })] }));
|
|
332
333
|
}
|
|
333
334
|
function FacetCell({ facet, row, pinIcon, }) {
|
|
334
|
-
return (_jsxs("span", { className: "ds-combobox__facet-content", children: [facet.icon, _jsx("span", { className: "ds-combobox__facet-label", children: facet.label }), row.pinnable && (_jsx("button", { type: "button", tabIndex: -1, className: "ds-combobox__pin", "aria-label": `Filter by ${facet.label}`, "aria-pressed": row.pinned, "data-pin": "", "data-active": row.pinActive ? '' : undefined, children: _jsx(Icon, { source: pinIcon, size: "sm", decorative: true }) }))] }));
|
|
335
|
+
return (_jsxs("span", { className: "ds-combobox__facet-content", children: [facet.icon, _jsx("span", { className: "ds-combobox__facet-label", children: facet.label }), row.pinnable && (_jsx(Tooltip, { content: `Filter by ${facet.label}`, kind: "label", children: _jsx("button", { type: "button", tabIndex: -1, className: "ds-combobox__pin", "aria-label": `Filter by ${facet.label}`, "aria-pressed": row.pinned, "data-pin": "", "data-active": row.pinActive ? '' : undefined, children: _jsx(Icon, { source: pinIcon, size: "sm", decorative: true }) }) }))] }));
|
|
335
336
|
}
|
|
336
337
|
function PinnedChip({ facet, removeIcon, onRemove }) {
|
|
337
|
-
return (_jsxs("span", { className: "ds-combobox__chip", children: [facet.icon, _jsx("span", { children: facet.label }), _jsx("button", { type: "button", className: "ds-combobox__chip-remove", "aria-label": `Stop filtering by ${facet.label}`, onClick: onRemove, children: _jsx(Icon, { source: removeIcon, size: "sm", decorative: true }) })] }));
|
|
338
|
+
return (_jsxs("span", { className: "ds-combobox__chip", children: [facet.icon, _jsx("span", { children: facet.label }), _jsx(Tooltip, { content: "Stop filtering", kind: "label", children: _jsx("button", { type: "button", className: "ds-combobox__chip-remove", "aria-label": `Stop filtering by ${facet.label}`, onClick: onRemove, children: _jsx(Icon, { source: removeIcon, size: "sm", decorative: true }) }) })] }));
|
|
338
339
|
}
|
|
339
340
|
//# sourceMappingURL=combobox.js.map
|