@alleninstitute/cortex-ui 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +52 -8
  2. package/dist/cjs/cortex-ui.cjs.js +3 -3
  3. package/dist/cjs/cui-divider.cjs.entry.js +49 -0
  4. package/dist/cjs/cui-icon.cjs.entry.js +100 -0
  5. package/dist/cjs/cui-progress.cjs.entry.js +4 -4
  6. package/dist/cjs/cui-tag.cjs.entry.js +4 -4
  7. package/dist/cjs/index-RBrlguTk.js +1565 -0
  8. package/dist/cjs/loader.cjs.js +2 -2
  9. package/dist/collection/collection-manifest.json +3 -1
  10. package/dist/collection/components/cui-divider/cui-divider.css +100 -0
  11. package/dist/collection/components/cui-divider/cui-divider.js +150 -0
  12. package/dist/collection/components/cui-icon/cui-icon.css +134 -0
  13. package/dist/collection/components/cui-icon/cui-icon.js +239 -0
  14. package/dist/collection/components/cui-progress/cui-progress.css +12 -12
  15. package/dist/collection/components/cui-progress/cui-progress.js +2 -2
  16. package/dist/collection/components/cui-tag/cui-tag.css +19 -19
  17. package/dist/collection/components/cui-tag/cui-tag.js +5 -5
  18. package/dist/components/cui-divider.d.ts +11 -0
  19. package/dist/components/cui-divider.js +1 -0
  20. package/dist/components/cui-icon.d.ts +11 -0
  21. package/dist/components/cui-icon.js +1 -0
  22. package/dist/components/cui-progress.js +1 -1
  23. package/dist/components/cui-tag.js +1 -1
  24. package/dist/components/index.js +1 -1
  25. package/dist/cortex-ui/cortex-ui.css +1 -1
  26. package/dist/cortex-ui/cortex-ui.esm.js +1 -1
  27. package/dist/cortex-ui/p-0e66a721.entry.js +1 -0
  28. package/dist/cortex-ui/p-1af73c5a.entry.js +1 -0
  29. package/dist/cortex-ui/p-2d2004f0.entry.js +1 -0
  30. package/dist/cortex-ui/p-8925abbe.entry.js +1 -0
  31. package/dist/cortex-ui/p-BZmInLSX.js +3 -0
  32. package/dist/esm/cortex-ui.js +4 -4
  33. package/dist/esm/cui-divider.entry.js +47 -0
  34. package/dist/esm/cui-icon.entry.js +98 -0
  35. package/dist/esm/cui-progress.entry.js +4 -4
  36. package/dist/esm/cui-tag.entry.js +4 -4
  37. package/dist/esm/index-BZmInLSX.js +1557 -0
  38. package/dist/esm/loader.js +3 -3
  39. package/dist/fonts/AllenInstituteHeadline-Bold.woff2 +0 -0
  40. package/dist/fonts/AllenInstituteHeadline-BoldItalic.woff2 +0 -0
  41. package/dist/fonts/AllenInstituteHeadline-Italic.woff2 +0 -0
  42. package/dist/fonts/AllenInstituteHeadline-Light.woff2 +0 -0
  43. package/dist/fonts/AllenInstituteHeadline-LightItalic.woff2 +0 -0
  44. package/dist/fonts/AllenInstituteHeadline-Medium.woff2 +0 -0
  45. package/dist/fonts/AllenInstituteHeadline-MediumItalic.woff2 +0 -0
  46. package/dist/fonts/AllenInstituteHeadline-Regular.woff2 +0 -0
  47. package/dist/fonts/AllenInstituteHeadline-Semibold.woff2 +0 -0
  48. package/dist/fonts/AllenInstituteHeadline-SemiboldItalic.woff2 +0 -0
  49. package/dist/fonts/AllenInstituteText-Bold.woff2 +0 -0
  50. package/dist/fonts/AllenInstituteText-BoldItalic.woff2 +0 -0
  51. package/dist/fonts/AllenInstituteText-Italic.woff2 +0 -0
  52. package/dist/fonts/AllenInstituteText-Light.woff2 +0 -0
  53. package/dist/fonts/AllenInstituteText-LightItalic.woff2 +0 -0
  54. package/dist/fonts/AllenInstituteText-Medium.woff2 +0 -0
  55. package/dist/fonts/AllenInstituteText-MediumItalic.woff2 +0 -0
  56. package/dist/fonts/AllenInstituteText-Regular.woff2 +0 -0
  57. package/dist/fonts/AllenInstituteText-Semibold.woff2 +0 -0
  58. package/dist/fonts/AllenInstituteText-SemiboldItalic.woff2 +0 -0
  59. package/dist/fonts.css +186 -0
  60. package/dist/types/components/cui-divider/cui-divider.d.ts +38 -0
  61. package/dist/types/components/cui-icon/cui-icon.d.ts +76 -0
  62. package/dist/types/components/cui-tag/cui-tag.d.ts +1 -1
  63. package/dist/types/components.d.ts +235 -6
  64. package/dist/types/stencil-public-runtime.d.ts +11 -0
  65. package/package.json +31 -22
  66. package/dist/cjs/index-CJFDVa2g.js +0 -1415
  67. package/dist/collection/stories/assets/accessibility.svg +0 -1
  68. package/dist/collection/stories/assets/discord.svg +0 -1
  69. package/dist/collection/stories/assets/github.svg +0 -1
  70. package/dist/collection/stories/assets/tutorials.svg +0 -1
  71. package/dist/collection/stories/assets/youtube.svg +0 -1
  72. package/dist/cortex-ui/p-371566cd.entry.js +0 -1
  73. package/dist/cortex-ui/p-60c5b038.entry.js +0 -1
  74. package/dist/cortex-ui/p-DbXnQj5f.js +0 -2
  75. package/dist/esm/index-DbXnQj5f.js +0 -1408
@@ -1,10 +1,10 @@
1
- import { g as globalScripts, b as bootstrapLazy } from './index-DbXnQj5f.js';
2
- export { s as setNonce } from './index-DbXnQj5f.js';
1
+ import { g as globalScripts, b as bootstrapLazy } from './index-BZmInLSX.js';
2
+ export { s as setNonce } from './index-BZmInLSX.js';
3
3
 
4
4
  const defineCustomElements = async (win, options) => {
5
5
  if (typeof window === 'undefined') return undefined;
6
6
  await globalScripts();
7
- return bootstrapLazy([["cui-progress",[[1,"cui-progress",{"label":[1],"value":[2],"max":[2],"indeterminate":[4],"size":[1],"showValue":[4,"show-value"]}]]],["cui-tag",[[1,"cui-tag",{"label":[1],"variant":[1],"size":[1]}]]]], options);
7
+ return bootstrapLazy([["cui-divider",[[1,"cui-divider",{"orientation":[513],"spacing":[513],"variant":[1],"importance":[1]}]]],["cui-icon",[[257,"cui-icon",{"icon":[1],"variant":[1],"importance":[1],"size":[1],"label":[1]},null,{"icon":[{"onIconChange":0}],"label":[{"onLabelChange":0}]}]]],["cui-progress",[[1,"cui-progress",{"label":[1],"value":[2],"max":[2],"indeterminate":[4],"size":[1],"showValue":[4,"show-value"]}]]],["cui-tag",[[1,"cui-tag",{"label":[1],"variant":[1],"size":[1]}]]]], options);
8
8
  };
9
9
 
10
10
  export { defineCustomElements };
package/dist/fonts.css ADDED
@@ -0,0 +1,186 @@
1
+ /* ============================================
2
+ * Allen Institute web fonts
3
+ * ============================================
4
+ *
5
+ * `@font-face` is document-scoped, so these rules cannot live in `global.scss`:
6
+ * Stencil only ever adopts the global style into a component's shadow root, and font
7
+ * faces declared inside a shadow tree are ignored. Loading this file at the document
8
+ * level registers the faces once for the whole page, shadow DOM included.
9
+ *
10
+ * Consumers import it from the package root:
11
+ *
12
+ * import '@alleninstitute/cortex-ui/fonts.css';
13
+ *
14
+ * The `url()` paths are relative to this file, and the build copies this stylesheet and
15
+ * the `fonts/` directory beside it into `dist/` keeping that layout (see the `copy` tasks
16
+ * in stencil.config.ts), so the same paths resolve in this repo, through a consumer's
17
+ * bundler, and straight from a CDN.
18
+ *
19
+ * Only WOFF2 is shipped: every browser that can run these components supports it, and a
20
+ * WOFF fallback would double the payload for browsers nobody is targeting.
21
+ *
22
+ * The families are exposed as `--cui-font-family-base` (text) and
23
+ * `--cui-font-family-headline`; prefer those tokens over naming a family directly.
24
+ */
25
+
26
+ /* Allen Institute Text */
27
+ @font-face {
28
+ font-family: 'Allen Institute Text';
29
+ src: url('./fonts/AllenInstituteText-Light.woff2') format('woff2');
30
+ font-weight: 300;
31
+ font-style: normal;
32
+ font-display: swap;
33
+ }
34
+
35
+ @font-face {
36
+ font-family: 'Allen Institute Text';
37
+ src: url('./fonts/AllenInstituteText-LightItalic.woff2') format('woff2');
38
+ font-weight: 300;
39
+ font-style: italic;
40
+ font-display: swap;
41
+ }
42
+
43
+ @font-face {
44
+ font-family: 'Allen Institute Text';
45
+ src: url('./fonts/AllenInstituteText-Regular.woff2') format('woff2');
46
+ font-weight: 400;
47
+ font-style: normal;
48
+ font-display: swap;
49
+ }
50
+
51
+ @font-face {
52
+ font-family: 'Allen Institute Text';
53
+ src: url('./fonts/AllenInstituteText-Italic.woff2') format('woff2');
54
+ font-weight: 400;
55
+ font-style: italic;
56
+ font-display: swap;
57
+ }
58
+
59
+ @font-face {
60
+ font-family: 'Allen Institute Text';
61
+ src: url('./fonts/AllenInstituteText-Medium.woff2') format('woff2');
62
+ font-weight: 500;
63
+ font-style: normal;
64
+ font-display: swap;
65
+ }
66
+
67
+ @font-face {
68
+ font-family: 'Allen Institute Text';
69
+ src: url('./fonts/AllenInstituteText-MediumItalic.woff2') format('woff2');
70
+ font-weight: 500;
71
+ font-style: italic;
72
+ font-display: swap;
73
+ }
74
+
75
+ @font-face {
76
+ font-family: 'Allen Institute Text';
77
+ src: url('./fonts/AllenInstituteText-Semibold.woff2') format('woff2');
78
+ font-weight: 600;
79
+ font-style: normal;
80
+ font-display: swap;
81
+ }
82
+
83
+ @font-face {
84
+ font-family: 'Allen Institute Text';
85
+ src: url('./fonts/AllenInstituteText-SemiboldItalic.woff2') format('woff2');
86
+ font-weight: 600;
87
+ font-style: italic;
88
+ font-display: swap;
89
+ }
90
+
91
+ @font-face {
92
+ font-family: 'Allen Institute Text';
93
+ src: url('./fonts/AllenInstituteText-Bold.woff2') format('woff2');
94
+ font-weight: 700;
95
+ font-style: normal;
96
+ font-display: swap;
97
+ }
98
+
99
+ @font-face {
100
+ font-family: 'Allen Institute Text';
101
+ src: url('./fonts/AllenInstituteText-BoldItalic.woff2') format('woff2');
102
+ font-weight: 700;
103
+ font-style: italic;
104
+ font-display: swap;
105
+ }
106
+
107
+ /* Allen Institute Headline */
108
+ @font-face {
109
+ font-family: 'Allen Institute Headline';
110
+ src: url('./fonts/AllenInstituteHeadline-Light.woff2') format('woff2');
111
+ font-weight: 300;
112
+ font-style: normal;
113
+ font-display: swap;
114
+ }
115
+
116
+ @font-face {
117
+ font-family: 'Allen Institute Headline';
118
+ src: url('./fonts/AllenInstituteHeadline-LightItalic.woff2') format('woff2');
119
+ font-weight: 300;
120
+ font-style: italic;
121
+ font-display: swap;
122
+ }
123
+
124
+ @font-face {
125
+ font-family: 'Allen Institute Headline';
126
+ src: url('./fonts/AllenInstituteHeadline-Regular.woff2') format('woff2');
127
+ font-weight: 400;
128
+ font-style: normal;
129
+ font-display: swap;
130
+ }
131
+
132
+ @font-face {
133
+ font-family: 'Allen Institute Headline';
134
+ src: url('./fonts/AllenInstituteHeadline-Italic.woff2') format('woff2');
135
+ font-weight: 400;
136
+ font-style: italic;
137
+ font-display: swap;
138
+ }
139
+
140
+ @font-face {
141
+ font-family: 'Allen Institute Headline';
142
+ src: url('./fonts/AllenInstituteHeadline-Medium.woff2') format('woff2');
143
+ font-weight: 500;
144
+ font-style: normal;
145
+ font-display: swap;
146
+ }
147
+
148
+ @font-face {
149
+ font-family: 'Allen Institute Headline';
150
+ src: url('./fonts/AllenInstituteHeadline-MediumItalic.woff2') format('woff2');
151
+ font-weight: 500;
152
+ font-style: italic;
153
+ font-display: swap;
154
+ }
155
+
156
+ @font-face {
157
+ font-family: 'Allen Institute Headline';
158
+ src: url('./fonts/AllenInstituteHeadline-Semibold.woff2') format('woff2');
159
+ font-weight: 600;
160
+ font-style: normal;
161
+ font-display: swap;
162
+ }
163
+
164
+ @font-face {
165
+ font-family: 'Allen Institute Headline';
166
+ src: url('./fonts/AllenInstituteHeadline-SemiboldItalic.woff2') format('woff2');
167
+ font-weight: 600;
168
+ font-style: italic;
169
+ font-display: swap;
170
+ }
171
+
172
+ @font-face {
173
+ font-family: 'Allen Institute Headline';
174
+ src: url('./fonts/AllenInstituteHeadline-Bold.woff2') format('woff2');
175
+ font-weight: 700;
176
+ font-style: normal;
177
+ font-display: swap;
178
+ }
179
+
180
+ @font-face {
181
+ font-family: 'Allen Institute Headline';
182
+ src: url('./fonts/AllenInstituteHeadline-BoldItalic.woff2') format('woff2');
183
+ font-weight: 700;
184
+ font-style: italic;
185
+ font-display: swap;
186
+ }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * A Divider drawing a rule between sections of content, or between items in a row.
3
+ *
4
+ * @example
5
+ * <cui-divider></cui-divider>
6
+ *
7
+ * @example
8
+ * <cui-divider orientation="vertical" spacing="small"></cui-divider>
9
+ *
10
+ * @example
11
+ * <cui-divider variant="accent" importance="secondary"></cui-divider>
12
+ *
13
+ * @part base - The rule itself, for consumer-side style overrides.
14
+ */
15
+ export declare class CuiDivider {
16
+ /**
17
+ * Which way the rule runs. A vertical divider stretches to the height of the flex row
18
+ * it sits in.
19
+ */
20
+ orientation: 'horizontal' | 'vertical';
21
+ /** Space reserved on either side of the rule, along the axis it separates. */
22
+ spacing: 'none' | 'small' | 'medium' | 'large';
23
+ /**
24
+ * Which intent's `divider` colour the rule is drawn in. `base` is the intent-free rule for
25
+ * ordinary page chrome; the seven intents tint a divider that sits inside a component
26
+ * already carrying that intent, such as a rule between rows of a negative-intent alert.
27
+ */
28
+ variant: 'base' | 'accent' | 'highlight' | 'info' | 'negative' | 'neutral' | 'positive' | 'warning';
29
+ /**
30
+ * Which of the two `divider` importances the rule is drawn from. Match it to the importance of
31
+ * the surface the divider sits on — `secondary` on a quiet tint, `primary` on a saturated fill —
32
+ * rather than treating it as a loudness control: on a secondary surface the primary rule is the
33
+ * *less* perceivable of the two. For `base`, whose surface is the page itself, `primary` is
34
+ * simply the stronger of the two rules.
35
+ */
36
+ importance: 'primary' | 'secondary';
37
+ render(): any;
38
+ }
@@ -0,0 +1,76 @@
1
+ /**
2
+ * An Icon component that renders a Font Awesome glyph with cortex-ui's semantic colours and sizes.
3
+ *
4
+ * Font Awesome itself is **not** bundled — the consuming application loads a Font Awesome
5
+ * stylesheet (the free set, or a licensed pro build) and `icon` takes the raw Font Awesome
6
+ * classes. Any Font Awesome utility class can be passed along in the same string, so
7
+ * `icon="fa-solid fa-spinner fa-spin"` works without this component knowing about `fa-spin`.
8
+ *
9
+ * Loading that stylesheet is the human application owner's responsibility, never an agent's: an AI
10
+ * agent writing `cui-icon` markup must not install a Font Awesome package, add the stylesheet to
11
+ * the page, or invent a Pro Kit URL — it should write the markup and tell the person their page
12
+ * needs Font Awesome. Icons rendering as empty boxes in a page with no Font Awesome is the
13
+ * expected result, not a bug to code around.
14
+ *
15
+ * Icons are decorative by default and hidden from assistive technology. Set `label` only when the
16
+ * icon carries meaning that the surrounding text does not already convey.
17
+ *
18
+ * @example
19
+ * <cui-icon icon="fa-solid fa-user"></cui-icon>
20
+ *
21
+ * @example
22
+ * <cui-icon icon="fa-solid fa-triangle-exclamation" variant="warning" size="l"></cui-icon>
23
+ *
24
+ * @example
25
+ * <cui-icon icon="fa-solid fa-trash" label="Delete item"></cui-icon>
26
+ *
27
+ * @slot - The glyph element. This component creates and owns it, so do not place your own
28
+ * content in `cui-icon` — anything else you slot here is hidden.
29
+ * @part base - The root element, for consumer-side style overrides.
30
+ * @cssprop --cui-icon-color - Overrides the colour chosen by `variant` and `importance`. Set it to
31
+ * `currentColor` to make the icon follow the text colour of whatever surrounds it.
32
+ * @cssprop --cui-icon-size - Overrides the size chosen by `size`.
33
+ */
34
+ export declare class CuiIcon {
35
+ private el;
36
+ /**
37
+ * The Font Awesome classes naming the icon, e.g. `fa-solid fa-user`. The style is part of the
38
+ * string, so `fa-regular`, `fa-brands` and licensed pro styles like `fa-duotone` all work.
39
+ * Required — there is no sensible fallback glyph.
40
+ */
41
+ icon: string;
42
+ /**
43
+ * Semantic colour set. `base` is the intent-free choice for ordinary content and is correct on
44
+ * a plain page background; the intents are for an icon that sits on that intent's surface.
45
+ * This is styling, not semantics — never let colour be the only thing conveying meaning.
46
+ */
47
+ variant: 'accent' | 'base' | 'highlight' | 'info' | 'negative' | 'neutral' | 'positive' | 'warning';
48
+ /**
49
+ * Which rung of the `text` token family to use. It tracks the surface the icon sits on:
50
+ * `primary` belongs on that variant's primary surface, `secondary` on its secondary surface or
51
+ * on a plain background. Pairing an intent's `primary` text with a plain page background is
52
+ * outside the token system's design and will not be legible.
53
+ */
54
+ importance: 'primary' | 'secondary';
55
+ /** Size of the glyph, from the font-size token scale. */
56
+ size: 'display-l' | 'display-m' | 'display-s' | 'l' | 'm' | 's' | 'xl' | 'xs' | 'xxl' | 'xxs';
57
+ /**
58
+ * Accessible name, for an icon that carries meaning on its own — an icon-only button, or a
59
+ * status glyph with no adjacent text. Leave it unset for a decorative icon beside text, which
60
+ * is the common case; the icon is then hidden from assistive technology so screen readers do
61
+ * not announce it twice.
62
+ */
63
+ label?: string;
64
+ connectedCallback(): void;
65
+ onIconChange(): void;
66
+ onLabelChange(): void;
67
+ /**
68
+ * Creates or updates the light-DOM glyph. Queries rather than caching a node reference, so it
69
+ * is idempotent: connectedCallback fires again every time the host is moved in the DOM, and a
70
+ * cached reference can also go stale (see below).
71
+ */
72
+ private syncGlyph;
73
+ /** An icon is either named or hidden — never both, and never named with an empty string. */
74
+ private syncAria;
75
+ render(): any;
76
+ }
@@ -6,7 +6,7 @@
6
6
  */
7
7
  export declare class CuiTag {
8
8
  label: string;
9
- variant: 'default' | 'highlight' | 'info' | 'negative' | 'neutral' | 'positive' | 'warning';
9
+ variant: 'accent' | 'highlight' | 'info' | 'negative' | 'neutral' | 'positive' | 'warning';
10
10
  size: 'small' | 'medium';
11
11
  render(): any;
12
12
  }