@zylem/ui 0.8.14 → 0.9.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 (57) hide show
  1. package/dist/styles.css +1 -1
  2. package/package.json +1 -1
  3. package/src/components/Accordion/Accordion.tsx +4 -1
  4. package/src/components/BuildLabel/BuildLabel.tsx +0 -1
  5. package/src/components/BuildLabel/mount-build-label.ts +0 -1
  6. package/src/components/Callout/Callout.tsx +1 -1
  7. package/src/components/Card/Card.css.ts +1 -0
  8. package/src/components/Card/Card.tsx +11 -2
  9. package/src/components/Checkbox/Checkbox.tsx +4 -2
  10. package/src/components/ColorPalette/ColorPalette.tsx +1 -1
  11. package/src/components/Console/Console.tsx +3 -0
  12. package/src/components/Dialog/Dialog.css.ts +41 -17
  13. package/src/components/Dialog/Dialog.tsx +134 -53
  14. package/src/components/FrameStrip/FrameStrip.tsx +2 -3
  15. package/src/components/ItemPicker/ItemPicker.tsx +46 -33
  16. package/src/components/MenuButton/MenuButton.tsx +1 -0
  17. package/src/components/Mixer/Knob.tsx +10 -3
  18. package/src/components/Mixer/Mixer.css.ts +19 -0
  19. package/src/components/Mixer/MixerStrip.tsx +29 -8
  20. package/src/components/NumberField/NumberField.tsx +5 -2
  21. package/src/components/Panel/Panel.css.ts +1 -0
  22. package/src/components/Panel/Panel.tsx +9 -1
  23. package/src/components/PianoRoll/PianoRoll.tsx +1 -0
  24. package/src/components/Progress/Progress.tsx +3 -0
  25. package/src/components/Property/Property.css.ts +13 -0
  26. package/src/components/Property/Property.tsx +3 -2
  27. package/src/components/SearchInput/SearchInput.tsx +1 -1
  28. package/src/components/Select/Select.tsx +3 -1
  29. package/src/components/Sidebar/Sidebar.css.ts +1 -0
  30. package/src/components/Sidebar/Sidebar.tsx +23 -5
  31. package/src/components/Slider/Slider.tsx +4 -2
  32. package/src/components/Switch/Switch.tsx +3 -1
  33. package/src/components/Tabs/Tabs.css.ts +0 -5
  34. package/src/components/Tabs/Tabs.tsx +23 -12
  35. package/src/components/TextField/TextField.tsx +4 -0
  36. package/src/components/TimelineLanes/TimelineLanes.css.ts +6 -0
  37. package/src/components/TimelineLanes/TimelineLanes.tsx +52 -4
  38. package/src/components/TimelineLanes/lanes-math.ts +51 -0
  39. package/src/components/TimelineTrack/TimelineTrack.tsx +16 -3
  40. package/src/components/TitleBar/TitleBar.css.ts +1 -0
  41. package/src/components/TitleBar/TitleBar.tsx +7 -1
  42. package/src/components/Toast/Toast.tsx +1 -2
  43. package/src/components/ToolButton/ToolButton.tsx +1 -1
  44. package/src/components/Toolbar/Toolbar.tsx +6 -1
  45. package/src/components/ToolbarButton/ToolbarButton.tsx +9 -2
  46. package/src/components/ToolboxButton/ToolboxButton.tsx +2 -1
  47. package/src/components/TrackHeader/TrackHeader.css.ts +21 -0
  48. package/src/components/TrackHeader/TrackHeader.tsx +37 -12
  49. package/src/components/TransportBar/TransportBar.tsx +4 -1
  50. package/src/components/Waveform/Waveform.css.ts +10 -0
  51. package/src/components/Waveform/Waveform.tsx +59 -27
  52. package/src/components/WindowControls/WindowControls.tsx +4 -4
  53. package/src/components/index.ts +1 -0
  54. package/src/components/shared/Heading.tsx +30 -0
  55. package/src/global/accordion.css.ts +6 -1
  56. package/src/global/common.css.ts +13 -0
  57. package/src/layers/LayerContext.tsx +2 -2
@@ -23,7 +23,7 @@ export interface WindowControlsProps {
23
23
  export function WindowControls(props: WindowControlsProps) {
24
24
  return (
25
25
  <Show when={props.onClose || props.onCollapse}>
26
- <div class="zylem-window-controls" aria-label="Window controls">
26
+ <div class="zylem-window-controls" role="group" aria-label="Window controls">
27
27
  <Show when={props.onCollapse}>
28
28
  <button
29
29
  type="button"
@@ -33,9 +33,9 @@ export function WindowControls(props: WindowControlsProps) {
33
33
  onClick={() => props.onCollapse?.()}
34
34
  >
35
35
  {props.collapsed ? (
36
- <ChevronUp size={11} strokeWidth={2.5} />
36
+ <ChevronUp size={11} strokeWidth={2.5} aria-hidden="true" />
37
37
  ) : (
38
- <ChevronDown size={11} strokeWidth={2.5} />
38
+ <ChevronDown size={11} strokeWidth={2.5} aria-hidden="true" />
39
39
  )}
40
40
  </button>
41
41
  </Show>
@@ -48,7 +48,7 @@ export function WindowControls(props: WindowControlsProps) {
48
48
  data-testid={props.closeTestId}
49
49
  onClick={() => props.onClose?.()}
50
50
  >
51
- <X size={11} strokeWidth={2.5} />
51
+ <X size={11} strokeWidth={2.5} aria-hidden="true" />
52
52
  </button>
53
53
  </Show>
54
54
  </div>
@@ -24,6 +24,7 @@ export {
24
24
  } from '../layers';
25
25
 
26
26
  // Primitives
27
+ export { type HeadingLevel } from './shared/Heading';
27
28
  export { Button, type ButtonProps, type ButtonVariant, type ButtonSize } from './Button/Button';
28
29
  export { ToolbarButton, type ToolbarButtonProps } from './ToolbarButton/ToolbarButton';
29
30
  export { TextField, type TextFieldProps } from './TextField/TextField';
@@ -0,0 +1,30 @@
1
+ import type { JSX } from 'solid-js';
2
+ import { Dynamic } from 'solid-js/web';
3
+
4
+ /** Outline level of a component's title: `2` renders an `<h2>`. */
5
+ export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
6
+
7
+ /** The element name for a level, for primitives that take an `as` tag. */
8
+ export function headingTag(level: HeadingLevel) {
9
+ return `h${level}` as const;
10
+ }
11
+
12
+ export interface HeadingProps {
13
+ level: HeadingLevel;
14
+ id?: string | undefined;
15
+ class?: string | undefined;
16
+ title?: string | undefined;
17
+ children: JSX.Element;
18
+ }
19
+
20
+ /**
21
+ * An `<h1>`…`<h6>` chosen at runtime, for titles whose place in the page
22
+ * outline is the host's call.
23
+ */
24
+ export function Heading(props: HeadingProps) {
25
+ return (
26
+ <Dynamic component={headingTag(props.level)} id={props.id} class={props.class} title={props.title}>
27
+ {props.children}
28
+ </Dynamic>
29
+ );
30
+ }
@@ -14,11 +14,14 @@ globalStyle('.zylem-accordion', {
14
14
  minHeight: 0,
15
15
  });
16
16
 
17
+ // The header is a heading element; its UA margins would open gaps around the
18
+ // trigger, and differ by heading level.
17
19
  globalStyle('.accordion-header', {
18
20
  position: 'sticky',
19
21
  top: 0,
20
22
  zIndex: 1,
21
23
  display: 'flex',
24
+ margin: 0,
22
25
  });
23
26
 
24
27
  globalStyle('.accordion-item', {
@@ -105,7 +108,9 @@ globalStyle('.zylem-accordion--stack .accordion-content', {
105
108
  });
106
109
 
107
110
  globalStyle('.accordion-trigger::after', {
108
- content: "'\\25BC'",
111
+ // The empty alternative text keeps the chevron out of the trigger's
112
+ // accessible name; the first value is for browsers without that syntax.
113
+ content: ["'\\25BC'", "'\\25BC' / ''"],
109
114
  position: 'relative',
110
115
  color: vars.colors.textSecondary,
111
116
  fontSize: '10px',
@@ -13,6 +13,19 @@ globalStyle('.overlay', {
13
13
  pointerEvents: 'none',
14
14
  });
15
15
 
16
+ // Text for assistive tech only: off screen, still in the accessibility tree.
17
+ globalStyle('.zylem-visually-hidden', {
18
+ position: 'absolute',
19
+ width: '1px',
20
+ height: '1px',
21
+ padding: 0,
22
+ margin: '-1px',
23
+ overflow: 'hidden',
24
+ clip: 'rect(0, 0, 0, 0)',
25
+ whiteSpace: 'nowrap',
26
+ border: 0,
27
+ });
28
+
16
29
  // Default scrollbars: slim glass rail (use `.zylem-scroll` for the full
17
30
  // 13px HyperGlass treatment defined in hyperglass-base.css.ts).
18
31
  globalStyle('::-webkit-scrollbar', {
@@ -60,8 +60,8 @@ export interface LayerScopeProps {
60
60
  * them can paint above anything outside; and the scope owns the portal container
61
61
  * its descendants mount into, so overlays opened inside it stay inside it.
62
62
  *
63
- * A dialog wraps its content in one, so a tooltip opened within the dialog floats
64
- * over the dialog body without also floating over a menu belonging to the page.
63
+ * A dialog puts its card in one, so a menu opened within the dialog mounts
64
+ * inside the `<dialog>`, floats over the card, and is not clipped by it.
65
65
  */
66
66
  export function LayerScope(props: LayerScopeProps) {
67
67
  const [container, setContainer] = createSignal<HTMLElement>();