@wtfalch/design 0.3.0 → 0.3.1

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 CHANGED
@@ -169,7 +169,7 @@ case nobody has had; when it comes, the product entry is where to bind it.
169
169
 
170
170
  ## Status
171
171
 
172
- `0.3.0`. Twenty-eight components, every one of the 70 gallery specimens
172
+ `0.3.1`. Twenty-eight components, every one of the 70 gallery specimens
173
173
  photographed in four themes, the open windows photographed too, and the
174
174
  contrast, reduced-motion and keyboard rules are tests rather than sentences.
175
175
  It came out of [tf](https://github.com/wtfalch/tf), which is its first consumer;
@@ -1,4 +1,4 @@
1
- import { type BrandName } from './brandMarks';
1
+ import { type BrandName } from './brandMarks.js';
2
2
  /**
3
3
  * A product's mark, at header size.
4
4
  *
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { BRAND_MARKS, BRAND_NAMES } from './brandMarks';
2
+ import { BRAND_MARKS, BRAND_NAMES } from './brandMarks.js';
3
3
  /**
4
4
  * A product's mark, at header size.
5
5
  *
@@ -19,7 +19,7 @@
19
19
  * reason, because a message that expires while you are reading it was never
20
20
  * really shown.
21
21
  */
22
- import { type IconName } from './Icon';
22
+ import { type IconName } from './Icon.js';
23
23
  export default function Callout({ tone, children, icon, timed, onDismiss, className, }: {
24
24
  tone?: 'info' | 'good' | 'warn' | 'bad';
25
25
  children: React.ReactNode;
@@ -21,7 +21,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
21
21
  * really shown.
22
22
  */
23
23
  import { useEffect, useRef, useState } from 'react';
24
- import Icon from './Icon';
24
+ import Icon from './Icon.js';
25
25
  /** Long enough to read twice, which is how long it takes to notice something
26
26
  * appeared and then read it.
27
27
  *
@@ -17,7 +17,7 @@
17
17
  * word twice to a screen reader. It is there to make a page of cards scannable
18
18
  * by shape, which is a thing eyes do and readers do not.
19
19
  */
20
- import { type IconName } from './Icon';
20
+ import { type IconName } from './Icon.js';
21
21
  export default function Card({ icon, title, description, action, children, tone, onClick, selected, className, }: {
22
22
  icon?: IconName;
23
23
  title?: React.ReactNode;
@@ -18,7 +18,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
18
18
  * word twice to a screen reader. It is there to make a page of cards scannable
19
19
  * by shape, which is a thing eyes do and readers do not.
20
20
  */
21
- import Icon from './Icon';
21
+ import Icon from './Icon.js';
22
22
  export default function Card({ icon, title, description, action, children, tone, onClick, selected, className, }) {
23
23
  const head = (title || description || action) && (_jsxs("div", { className: "card-head", children: [icon && (_jsx("span", { className: "card-icon", "aria-hidden": "true", children: _jsx(Icon, { name: icon, size: 20 }) })), _jsxs("div", { className: "card-headings", children: [title && _jsx("strong", { className: "card-title", children: title }), description && _jsx("div", { className: "card-desc", children: description })] }), action && _jsx("div", { className: "card-action", children: action })] }));
24
24
  const cls = `card${onClick ? ' card-pick' : ''}${selected ? ' card-on' : ''}${tone ? ` card-${tone}` : ''}${className ? ` ${className}` : ''}`;
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useState } from 'react';
3
- import Button from './Button';
4
- import Field from './Field';
5
- import Input from './Input';
3
+ import Button from './Button.js';
4
+ import Field from './Field.js';
5
+ import Input from './Input.js';
6
6
  /**
7
7
  * The bottom of a settings panel, where the things that cannot be undone live.
8
8
  *
@@ -20,7 +20,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
20
20
  * decision that must be made has no Escape key, because dismissing it would be
21
21
  * choosing on the reader's behalf.
22
22
  */
23
- import Modal from './Modal';
23
+ import Modal from './Modal.js';
24
24
  export default function Dialog({ title, children, onCancel, actions, tone, }) {
25
25
  return (_jsx(Modal, { title: title, className: `dialog${tone ? ` dialog-${tone}` : ''}`, onClose: onCancel, dismissOnScrim: false,
26
26
  /* The answers are the buttons. A ✕ beside them is a third answer that
@@ -27,8 +27,8 @@
27
27
  * itself in whatever it was put in. Same component, because it is the same
28
28
  * three jobs: say it is empty, say why, offer the next thing.
29
29
  */
30
- import { type IconName } from './Icon';
31
- import { type IllustrationName } from './Illustration';
30
+ import { type IconName } from './Icon.js';
31
+ import { type IllustrationName } from './Illustration.js';
32
32
  export default function Empty({ icon, illustration, children, action, className, }: {
33
33
  /** Decoration. Omit it where the surrounding card already carries one. */
34
34
  icon?: IconName;
@@ -28,8 +28,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
28
28
  * itself in whatever it was put in. Same component, because it is the same
29
29
  * three jobs: say it is empty, say why, offer the next thing.
30
30
  */
31
- import Icon from './Icon';
32
- import Illustration from './Illustration';
31
+ import Icon from './Icon.js';
32
+ import Illustration from './Illustration.js';
33
33
  export default function Empty({ icon, illustration, children, action, className, }) {
34
34
  return (_jsxs("div", { className: `nothing${illustration ? ' nothing-surface' : ''}${className ? ` ${className}` : ''}`, children: [illustration ? (_jsx(Illustration, { name: illustration, size: 160, className: "nothing-figure" })) : (icon && (_jsx("span", { className: "nothing-mark", "aria-hidden": "true", children: _jsx(Icon, { name: icon, size: 20 }) }))), _jsx("p", { className: "nothing-said", children: children }), action && _jsx("div", { className: "nothing-act", children: action })] }));
35
35
  }
@@ -51,7 +51,7 @@
51
51
  * spinner arrow-spin
52
52
  file file
53
53
  */
54
- import type { IconName } from './iconNames';
54
+ import type { IconName } from './iconNames.js';
55
55
  export type { IconName };
56
56
  export default function Icon({ name, size, className, title, }: {
57
57
  name: IconName;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { ICONS } from './icons';
2
+ import { ICONS } from './icons.js';
3
3
  export default function Icon({ name, size = 18, className, title, }) {
4
4
  /* The table with its measured views is `icons.ts`, beside this file. */
5
5
  const g = ICONS[name];
@@ -23,7 +23,7 @@
23
23
  * went wrong is noise; the caller passes `alt` only when the picture is the
24
24
  * message, which so far it never is.
25
25
  */
26
- import { type IllustrationName } from '../illustrations';
26
+ import { type IllustrationName } from '../illustrations.js';
27
27
  export type { IllustrationName };
28
28
  export default function Illustration({ name, size, alt, className, }: {
29
29
  name: IllustrationName;
@@ -24,7 +24,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
24
24
  * went wrong is noise; the caller passes `alt` only when the picture is the
25
25
  * message, which so far it never is.
26
26
  */
27
- import { ILLUSTRATION_SVG } from '../illustrations';
27
+ import { ILLUSTRATION_SVG } from '../illustrations.js';
28
28
  /* Read at build time and inlined, so there is no request and nothing to fail on
29
29
  an offline first run -- which is the run these are most likely to appear on.
30
30
 
@@ -40,7 +40,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
40
40
  */
41
41
  import { forwardRef, useState } from 'react';
42
42
  import { ToggleButton } from 'react-aria-components';
43
- import Icon from './Icon';
43
+ import Icon from './Icon.js';
44
44
  const Input = forwardRef(function Input({ size = 'md', mono, block, className, type = 'text', ...rest }, ref) {
45
45
  const classes = [
46
46
  size === 'md' ? '' : `size-${size}`,
@@ -26,8 +26,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
26
26
  */
27
27
  import { useEffect, useId, useRef } from 'react';
28
28
  import { Modal as AriaModal, Dialog, Heading, ModalOverlay } from 'react-aria-components';
29
- import Button from './Button';
30
- import Icon from './Icon';
29
+ import Button from './Button.js';
30
+ import Icon from './Icon.js';
31
31
  /* The trap is the same obligation wherever it applies, and the studio needs it
32
32
  without being shaped like this, so it lives in a hook rather than here. */
33
33
  export default function Modal({ title, description, subtitle, head, children, footer, footerClass, onClose, closeDisabled = false, width, bodyClass, className, dismissOnScrim = true, closeButton = true, labelledBy, }) {
@@ -17,7 +17,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
17
17
  * The failing case passes `tone="bad"`, which is the one that promotes itself.
18
18
  */
19
19
  import { createContext, useContext, useMemo, useState } from 'react';
20
- import Icon from './Icon';
20
+ import Icon from './Icon.js';
21
21
  import { UNSTABLE_Toast as AriaToast, Button, Text, UNSTABLE_ToastContent as ToastContent, UNSTABLE_ToastQueue as ToastQueue, UNSTABLE_ToastRegion as ToastRegion, } from 'react-aria-components';
22
22
  const MARK = {
23
23
  info: 'info',
@@ -24,8 +24,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
24
  */
25
25
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
26
26
  import { createPortal } from 'react-dom';
27
- import Button from './Button';
28
- import { markTourSeen } from './tourMarker';
27
+ import Button from './Button.js';
28
+ import { markTourSeen } from './tourMarker.js';
29
29
  export default function Tour({ stops, onDone, storageKey, }) {
30
30
  const [at, setAt] = useState(0);
31
31
  const [box, setBox] = useState(null);
@@ -1,4 +1,4 @@
1
- import type { IconName } from './iconNames';
1
+ import type { IconName } from './iconNames.js';
2
2
  /** A glyph, with the viewBox it is drawn *at* rather than the one it shipped in. */
3
3
  export interface Glyph {
4
4
  /** `x y w h`, measured. Not the source viewBox. */
package/dist/index.d.ts CHANGED
@@ -16,69 +16,69 @@
16
16
  * exists to prevent, and several of them are the only written record of a bug
17
17
  * that shipped. They are worth more than the code around them.
18
18
  */
19
- export { default as Brand } from './components/Brand';
19
+ export { default as Brand } from './components/Brand.js';
20
20
  /** Every product's mark by name, and the path itself for an icon cut from
21
21
  * the same drawing. */
22
- export { BRAND_MARKS, BRAND_NAMES } from './components/brandMarks';
23
- export type { BrandName, FillMark, Mark, StrokeMark } from './components/brandMarks';
24
- export { default as Button } from './components/Button';
25
- export type { Props as ButtonProps } from './components/Button';
26
- export { default as Callout } from './components/Callout';
27
- export { default as Card } from './components/Card';
28
- export { default as Checkbox } from './components/Checkbox';
29
- export { DangerAction, default as DangerZone } from './components/DangerZone';
30
- export { default as Dialog } from './components/Dialog';
31
- export { default as Empty } from './components/Empty';
32
- export { default as Field } from './components/Field';
33
- export type { FieldWiring } from './components/Field';
34
- export { default as Icon } from './components/Icon';
35
- export { ICON_NAMES } from './components/iconNames';
36
- export type { IconName } from './components/iconNames';
37
- export { default as Illustration } from './components/Illustration';
38
- export { default as Input } from './components/Input';
39
- export type { Props as InputProps } from './components/Input';
40
- export { default as Markdown } from './components/Markdown';
41
- export { default as Modal } from './components/Modal';
42
- export { default as Pill } from './components/Pill';
43
- export { default as Progress } from './components/Progress';
44
- export { Row, Rows } from './components/Rows';
45
- export { default as Select } from './components/Select';
46
- export { default as SizeGrid } from './components/SizeGrid';
47
- export { default as Skeleton } from './components/Skeleton';
48
- export { default as Slider } from './components/Slider';
49
- export { default as Table } from './components/Table';
50
- export type { Column } from './components/Table';
51
- export { default as Tabs } from './components/Tabs';
52
- export type { Tab, TabGroup } from './components/Tabs';
53
- export { default as Textarea } from './components/Textarea';
54
- export type { Props as TextareaProps } from './components/Textarea';
55
- export { Toast, ToastHost, useToast } from './components/Toast';
56
- export { default as Toggle } from './components/Toggle';
57
- export { default as Tooltip } from './components/Tooltip';
58
- export { default as Tour } from './components/Tour';
59
- export type { TourStop } from './components/Tour';
22
+ export { BRAND_MARKS, BRAND_NAMES } from './components/brandMarks.js';
23
+ export type { BrandName, FillMark, Mark, StrokeMark } from './components/brandMarks.js';
24
+ export { default as Button } from './components/Button.js';
25
+ export type { Props as ButtonProps } from './components/Button.js';
26
+ export { default as Callout } from './components/Callout.js';
27
+ export { default as Card } from './components/Card.js';
28
+ export { default as Checkbox } from './components/Checkbox.js';
29
+ export { DangerAction, default as DangerZone } from './components/DangerZone.js';
30
+ export { default as Dialog } from './components/Dialog.js';
31
+ export { default as Empty } from './components/Empty.js';
32
+ export { default as Field } from './components/Field.js';
33
+ export type { FieldWiring } from './components/Field.js';
34
+ export { default as Icon } from './components/Icon.js';
35
+ export { ICON_NAMES } from './components/iconNames.js';
36
+ export type { IconName } from './components/iconNames.js';
37
+ export { default as Illustration } from './components/Illustration.js';
38
+ export { default as Input } from './components/Input.js';
39
+ export type { Props as InputProps } from './components/Input.js';
40
+ export { default as Markdown } from './components/Markdown.js';
41
+ export { default as Modal } from './components/Modal.js';
42
+ export { default as Pill } from './components/Pill.js';
43
+ export { default as Progress } from './components/Progress.js';
44
+ export { Row, Rows } from './components/Rows.js';
45
+ export { default as Select } from './components/Select.js';
46
+ export { default as SizeGrid } from './components/SizeGrid.js';
47
+ export { default as Skeleton } from './components/Skeleton.js';
48
+ export { default as Slider } from './components/Slider.js';
49
+ export { default as Table } from './components/Table.js';
50
+ export type { Column } from './components/Table.js';
51
+ export { default as Tabs } from './components/Tabs.js';
52
+ export type { Tab, TabGroup } from './components/Tabs.js';
53
+ export { default as Textarea } from './components/Textarea.js';
54
+ export type { Props as TextareaProps } from './components/Textarea.js';
55
+ export { Toast, ToastHost, useToast } from './components/Toast.js';
56
+ export { default as Toggle } from './components/Toggle.js';
57
+ export { default as Tooltip } from './components/Tooltip.js';
58
+ export { default as Tour } from './components/Tour.js';
59
+ export type { TourStop } from './components/Tour.js';
60
60
  /** The tour's memory. `forgetTour` is what onboarding calls so a config reset
61
61
  * replays the tour rather than leaving it suppressed by a browser that has
62
62
  * seen it. */
63
- export { DEFAULT_TOUR_KEY, forgetTour, markTourSeen, tourSeen } from './components/tourMarker';
63
+ export { DEFAULT_TOUR_KEY, forgetTour, markTourSeen, tourSeen } from './components/tourMarker.js';
64
64
  /** The art. Its own module because it is ~200 KB of inlined SVG — referenced
65
65
  * only by `Illustration`, so a bundler that drops the component drops the art
66
66
  * with it. */
67
- export { ILLUSTRATIONS } from './illustrations';
68
- export type { IllustrationName } from './illustrations';
67
+ export { ILLUSTRATIONS } from './illustrations.js';
68
+ export type { IllustrationName } from './illustrations.js';
69
69
  /** The focus trap, for a window that genuinely is not `Modal`'s shape. Use
70
70
  * `Modal` first: every one of the app's eight hand-built modals shipped
71
71
  * without a trap, which is what this exists to stop happening again. */
72
- export { useTrapFocus } from './hooks/useTrapFocus';
73
- export { DEFAULT_THEME, DERIVED_TOKENS, FIXED_TOKENS, THEMES, TOKEN_KEYS, applyTheme, defineTheme, isTheme, resolvedTokens, } from './themes';
74
- export type { Theme, ThemeTokens } from './themes';
72
+ export { useTrapFocus } from './hooks/useTrapFocus.js';
73
+ export { DEFAULT_THEME, DERIVED_TOKENS, FIXED_TOKENS, THEMES, TOKEN_KEYS, applyTheme, defineTheme, isTheme, resolvedTokens, } from './themes/index.js';
74
+ export type { Theme, ThemeTokens } from './themes/index.js';
75
75
  /** A theme as the rule a consumer ships for first paint, generated so it
76
76
  * cannot drift from the object; and a product's whole stylesheet the same way. */
77
- export { productCss, productStylesheet, themeCss, themeId } from './themes/css';
77
+ export { productCss, productStylesheet, themeCss, themeId } from './themes/css.js';
78
78
  /** The measurement behind the contrast rule, for a theme that is yours. */
79
- export { luminance, ratio } from './contrast';
79
+ export { luminance, ratio } from './contrast.js';
80
80
  /** The products: the layer between the system and a theme. Each also ships
81
81
  * as its own entry, `@wtfalch/design/<name>` and `<name>.css`, where `Brand`,
82
82
  * `THEMES` and `applyTheme` are that product's. */
83
- export { PRODUCTS, bindProduct, defineProduct, productTheme } from './products';
84
- export type { Product } from './products';
83
+ export { PRODUCTS, bindProduct, defineProduct, productTheme } from './products/index.js';
84
+ export type { Product } from './products/index.js';
package/dist/index.js CHANGED
@@ -16,60 +16,60 @@
16
16
  * exists to prevent, and several of them are the only written record of a bug
17
17
  * that shipped. They are worth more than the code around them.
18
18
  */
19
- export { default as Brand } from './components/Brand';
19
+ export { default as Brand } from './components/Brand.js';
20
20
  /** Every product's mark by name, and the path itself for an icon cut from
21
21
  * the same drawing. */
22
- export { BRAND_MARKS, BRAND_NAMES } from './components/brandMarks';
23
- export { default as Button } from './components/Button';
24
- export { default as Callout } from './components/Callout';
25
- export { default as Card } from './components/Card';
26
- export { default as Checkbox } from './components/Checkbox';
22
+ export { BRAND_MARKS, BRAND_NAMES } from './components/brandMarks.js';
23
+ export { default as Button } from './components/Button.js';
24
+ export { default as Callout } from './components/Callout.js';
25
+ export { default as Card } from './components/Card.js';
26
+ export { default as Checkbox } from './components/Checkbox.js';
27
27
  /* `DangerAction` is a component -- a row inside the zone -- and was exported as
28
28
  a type until the first consumer wrote `<DangerAction>` and TypeScript refused
29
29
  it (TS1362). Nothing in this repo renders one, which is how it went unseen. */
30
- export { DangerAction, default as DangerZone } from './components/DangerZone';
31
- export { default as Dialog } from './components/Dialog';
32
- export { default as Empty } from './components/Empty';
33
- export { default as Field } from './components/Field';
34
- export { default as Icon } from './components/Icon';
35
- export { ICON_NAMES } from './components/iconNames';
36
- export { default as Illustration } from './components/Illustration';
37
- export { default as Input } from './components/Input';
38
- export { default as Markdown } from './components/Markdown';
39
- export { default as Modal } from './components/Modal';
40
- export { default as Pill } from './components/Pill';
41
- export { default as Progress } from './components/Progress';
42
- export { Row, Rows } from './components/Rows';
43
- export { default as Select } from './components/Select';
44
- export { default as SizeGrid } from './components/SizeGrid';
45
- export { default as Skeleton } from './components/Skeleton';
46
- export { default as Slider } from './components/Slider';
47
- export { default as Table } from './components/Table';
48
- export { default as Tabs } from './components/Tabs';
49
- export { default as Textarea } from './components/Textarea';
50
- export { ToastHost, useToast } from './components/Toast';
51
- export { default as Toggle } from './components/Toggle';
52
- export { default as Tooltip } from './components/Tooltip';
53
- export { default as Tour } from './components/Tour';
30
+ export { DangerAction, default as DangerZone } from './components/DangerZone.js';
31
+ export { default as Dialog } from './components/Dialog.js';
32
+ export { default as Empty } from './components/Empty.js';
33
+ export { default as Field } from './components/Field.js';
34
+ export { default as Icon } from './components/Icon.js';
35
+ export { ICON_NAMES } from './components/iconNames.js';
36
+ export { default as Illustration } from './components/Illustration.js';
37
+ export { default as Input } from './components/Input.js';
38
+ export { default as Markdown } from './components/Markdown.js';
39
+ export { default as Modal } from './components/Modal.js';
40
+ export { default as Pill } from './components/Pill.js';
41
+ export { default as Progress } from './components/Progress.js';
42
+ export { Row, Rows } from './components/Rows.js';
43
+ export { default as Select } from './components/Select.js';
44
+ export { default as SizeGrid } from './components/SizeGrid.js';
45
+ export { default as Skeleton } from './components/Skeleton.js';
46
+ export { default as Slider } from './components/Slider.js';
47
+ export { default as Table } from './components/Table.js';
48
+ export { default as Tabs } from './components/Tabs.js';
49
+ export { default as Textarea } from './components/Textarea.js';
50
+ export { ToastHost, useToast } from './components/Toast.js';
51
+ export { default as Toggle } from './components/Toggle.js';
52
+ export { default as Tooltip } from './components/Tooltip.js';
53
+ export { default as Tour } from './components/Tour.js';
54
54
  /** The tour's memory. `forgetTour` is what onboarding calls so a config reset
55
55
  * replays the tour rather than leaving it suppressed by a browser that has
56
56
  * seen it. */
57
- export { DEFAULT_TOUR_KEY, forgetTour, markTourSeen, tourSeen } from './components/tourMarker';
57
+ export { DEFAULT_TOUR_KEY, forgetTour, markTourSeen, tourSeen } from './components/tourMarker.js';
58
58
  /** The art. Its own module because it is ~200 KB of inlined SVG — referenced
59
59
  * only by `Illustration`, so a bundler that drops the component drops the art
60
60
  * with it. */
61
- export { ILLUSTRATIONS } from './illustrations';
61
+ export { ILLUSTRATIONS } from './illustrations.js';
62
62
  /** The focus trap, for a window that genuinely is not `Modal`'s shape. Use
63
63
  * `Modal` first: every one of the app's eight hand-built modals shipped
64
64
  * without a trap, which is what this exists to stop happening again. */
65
- export { useTrapFocus } from './hooks/useTrapFocus';
66
- export { DEFAULT_THEME, DERIVED_TOKENS, FIXED_TOKENS, THEMES, TOKEN_KEYS, applyTheme, defineTheme, isTheme, resolvedTokens, } from './themes';
65
+ export { useTrapFocus } from './hooks/useTrapFocus.js';
66
+ export { DEFAULT_THEME, DERIVED_TOKENS, FIXED_TOKENS, THEMES, TOKEN_KEYS, applyTheme, defineTheme, isTheme, resolvedTokens, } from './themes/index.js';
67
67
  /** A theme as the rule a consumer ships for first paint, generated so it
68
68
  * cannot drift from the object; and a product's whole stylesheet the same way. */
69
- export { productCss, productStylesheet, themeCss, themeId } from './themes/css';
69
+ export { productCss, productStylesheet, themeCss, themeId } from './themes/css.js';
70
70
  /** The measurement behind the contrast rule, for a theme that is yours. */
71
- export { luminance, ratio } from './contrast';
71
+ export { luminance, ratio } from './contrast.js';
72
72
  /** The products: the layer between the system and a theme. Each also ships
73
73
  * as its own entry, `@wtfalch/design/<name>` and `<name>.css`, where `Brand`,
74
74
  * `THEMES` and `applyTheme` are that product's. */
75
- export { PRODUCTS, bindProduct, defineProduct, productTheme } from './products';
75
+ export { PRODUCTS, bindProduct, defineProduct, productTheme } from './products/index.js';
@@ -1,7 +1,7 @@
1
1
  import type { ComponentProps } from 'react';
2
- import BrandDefault from '../components/Brand';
3
- import type { BrandName } from '../components/brandMarks';
4
- import { type Theme, type ThemeTokens } from '../themes';
2
+ import BrandDefault from '../components/Brand.js';
3
+ import type { BrandName } from '../components/brandMarks.js';
4
+ import { type Theme, type ThemeTokens } from '../themes/index.js';
5
5
  /**
6
6
  * A product: the layer between the system and a theme.
7
7
  *
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import BrandDefault from '../components/Brand';
3
- import { applyTheme } from '../themes';
4
- import { themeId } from '../themes/css';
5
- import { tf } from './tf';
6
- import { valet } from './valet';
2
+ import BrandDefault from '../components/Brand.js';
3
+ import { applyTheme } from '../themes/index.js';
4
+ import { themeId } from '../themes/css.js';
5
+ import { tf } from './tf.js';
6
+ import { valet } from './valet.js';
7
7
  /** Every product, by the name of its mark. */
8
8
  export const PRODUCTS = { tf, valet };
9
9
  /** Declare a product, so a default that is not a theme or a key `applyTheme`
@@ -1,5 +1,5 @@
1
- import type { Theme } from '../themes';
2
- import type { Product } from './index';
1
+ import type { Theme } from '../themes/index.js';
2
+ import type { Product } from './index.js';
3
3
  /**
4
4
  * tf's themes: the three the package shipped with, and the ones the gallery
5
5
  * was photographed in first.
@@ -1,5 +1,5 @@
1
- import type { Theme, ThemeTokens } from '../themes';
2
- import type { Product } from './index';
1
+ import type { Theme, ThemeTokens } from '../themes/index.js';
2
+ import type { Product } from './index.js';
3
3
  /**
4
4
  * valet's identity: what it is under every theme.
5
5
  *
package/dist/tf.d.ts CHANGED
@@ -6,13 +6,13 @@
6
6
  * the same name from `export *`. A site is one product, so it imports this
7
7
  * and `@wtfalch/design/tf.css` and nothing of anyone else's.
8
8
  */
9
- export * from './index';
10
- export declare const product: import("./products").Product;
9
+ export * from './index.js';
10
+ export declare const product: import("./products/index.js").Product;
11
11
  export declare const Brand: (props: {
12
- name?: import("./index").BrandName;
12
+ name?: import("./index.js").BrandName;
13
13
  title?: string;
14
14
  className?: string;
15
15
  }) => import("react").JSX.Element;
16
- export declare const THEMES: Record<string, import("./themes").Theme>;
16
+ export declare const THEMES: Record<string, import("./themes/index.js").Theme>;
17
17
  export declare const DEFAULT_THEME: string;
18
- export declare const applyTheme: (theme?: string | import("./themes").Theme, el?: HTMLElement) => void;
18
+ export declare const applyTheme: (theme?: string | import("./themes/index.js").Theme, el?: HTMLElement) => void;
package/dist/tf.js CHANGED
@@ -6,9 +6,9 @@
6
6
  * the same name from `export *`. A site is one product, so it imports this
7
7
  * and `@wtfalch/design/tf.css` and nothing of anyone else's.
8
8
  */
9
- export * from './index';
10
- import { bindProduct } from './products';
11
- import { tf } from './products/tf';
9
+ export * from './index.js';
10
+ import { bindProduct } from './products/index.js';
11
+ import { tf } from './products/tf.js';
12
12
  const bound = bindProduct(tf);
13
13
  export const product = bound.product;
14
14
  export const Brand = bound.Brand;
@@ -1,4 +1,4 @@
1
- import type { Theme, ThemeTokens } from './index';
1
+ import type { Theme, ThemeTokens } from './index.js';
2
2
  /**
3
3
  * A theme as CSS, for the paint before React.
4
4
  *
@@ -15,9 +15,9 @@ import type { Theme, ThemeTokens } from './index';
15
15
  * which is `system`, gets no block: its palette is the base, and its light
16
16
  * half is the `prefers-color-scheme` block `base.css` scopes to it.
17
17
  *
18
- * No imports but a type, on purpose: `build-products.mjs` loads the compiled
19
- * copy of this file in plain Node, which cannot follow the package's
20
- * extensionless relative imports.
18
+ * `build-products.mjs` loads the compiled copy of this file in plain Node.
19
+ * Until 0.3.1 that meant it could import nothing but a type, because the build
20
+ * emitted relative imports without extensions; the build writes them now.
21
21
  */
22
22
  /** The name `applyTheme` derives for a theme object. */
23
23
  export declare function themeId(theme: Theme): string;
@@ -14,9 +14,9 @@
14
14
  * which is `system`, gets no block: its palette is the base, and its light
15
15
  * half is the `prefers-color-scheme` block `base.css` scopes to it.
16
16
  *
17
- * No imports but a type, on purpose: `build-products.mjs` loads the compiled
18
- * copy of this file in plain Node, which cannot follow the package's
19
- * extensionless relative imports.
17
+ * `build-products.mjs` loads the compiled copy of this file in plain Node.
18
+ * Until 0.3.1 that meant it could import nothing but a type, because the build
19
+ * emitted relative imports without extensions; the build writes them now.
20
20
  */
21
21
  /** The name `applyTheme` derives for a theme object. */
22
22
  export function themeId(theme) {
@@ -37,8 +37,8 @@
37
37
  * token added to the stylesheet and to no list fails the suite rather than
38
38
  * becoming a fourth, undocumented category.
39
39
  */
40
- import { TF_THEMES } from '../products/tf';
41
- import { VALET_THEMES } from '../products/valet';
40
+ import { TF_THEMES } from '../products/tf.js';
41
+ import { VALET_THEMES } from '../products/valet.js';
42
42
  /**
43
43
  * Computed from a themeable token, and not settable.
44
44
  *
package/dist/valet.d.ts CHANGED
@@ -6,13 +6,13 @@
6
6
  * the same name from `export *`. A site is one product, so it imports this
7
7
  * and `@wtfalch/design/valet.css` and nothing of anyone else's.
8
8
  */
9
- export * from './index';
10
- export declare const product: import("./products").Product;
9
+ export * from './index.js';
10
+ export declare const product: import("./products/index.js").Product;
11
11
  export declare const Brand: (props: {
12
- name?: import("./index").BrandName;
12
+ name?: import("./index.js").BrandName;
13
13
  title?: string;
14
14
  className?: string;
15
15
  }) => import("react").JSX.Element;
16
- export declare const THEMES: Record<string, import("./themes").Theme>;
16
+ export declare const THEMES: Record<string, import("./themes/index.js").Theme>;
17
17
  export declare const DEFAULT_THEME: string;
18
- export declare const applyTheme: (theme?: string | import("./themes").Theme, el?: HTMLElement) => void;
18
+ export declare const applyTheme: (theme?: string | import("./themes/index.js").Theme, el?: HTMLElement) => void;
package/dist/valet.js CHANGED
@@ -6,9 +6,9 @@
6
6
  * the same name from `export *`. A site is one product, so it imports this
7
7
  * and `@wtfalch/design/valet.css` and nothing of anyone else's.
8
8
  */
9
- export * from './index';
10
- import { bindProduct } from './products';
11
- import { valet } from './products/valet';
9
+ export * from './index.js';
10
+ import { bindProduct } from './products/index.js';
11
+ import { valet } from './products/valet.js';
12
12
  const bound = bindProduct(valet);
13
13
  export const product = bound.product;
14
14
  export const Brand = bound.Brand;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wtfalch/design",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "wtfalch's design system: themeable components on a fixed token vocabulary.",
5
5
  "keywords": [
6
6
  "design-system",
@@ -77,7 +77,7 @@
77
77
  "vitest": "^4.1.6"
78
78
  },
79
79
  "scripts": {
80
- "build": "rm -rf dist && tsc -p tsconfig.build.json && node scripts/copy-css.mjs && node scripts/build-products.mjs",
80
+ "build": "rm -rf dist && tsc -p tsconfig.build.json && node scripts/fix-extensions.mjs && node scripts/copy-css.mjs && node scripts/build-products.mjs",
81
81
  "typecheck": "tsc --noEmit",
82
82
  "test": "vitest run"
83
83
  }