@flowstack-ui/brick 0.1.12 → 0.2.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 (50) hide show
  1. package/dist/agents/color-picker.json +34 -18
  2. package/dist/agents/color-picker.md +18 -13
  3. package/dist/agents/color-swatch.json +17 -5
  4. package/dist/agents/color-swatch.md +10 -5
  5. package/dist/agents/coverage.json +1874 -1165
  6. package/dist/agents/manifest.json +1 -1
  7. package/dist/components/code-block/CodeBlock.d.ts +6 -3
  8. package/dist/components/code-block/CodeBlock.d.ts.map +1 -1
  9. package/dist/components/code-block/CodeBlock.js +19 -9
  10. package/dist/components/code-block/CodeBlock.js.map +1 -1
  11. package/dist/components/color-picker/ColorPicker.d.ts +83 -24
  12. package/dist/components/color-picker/ColorPicker.d.ts.map +1 -1
  13. package/dist/components/color-picker/ColorPicker.js +102 -10
  14. package/dist/components/color-picker/ColorPicker.js.map +1 -1
  15. package/dist/components/color-picker/index.d.ts +1 -1
  16. package/dist/components/color-picker/index.d.ts.map +1 -1
  17. package/dist/components/color-picker/index.js +1 -1
  18. package/dist/components/color-picker/index.js.map +1 -1
  19. package/dist/components/color-swatch/ColorSwatch.d.ts +3 -0
  20. package/dist/components/color-swatch/ColorSwatch.d.ts.map +1 -1
  21. package/dist/components/color-swatch/ColorSwatch.js +4 -4
  22. package/dist/components/color-swatch/ColorSwatch.js.map +1 -1
  23. package/dist/components/color-swatch/index.d.ts +1 -1
  24. package/dist/components/color-swatch/index.d.ts.map +1 -1
  25. package/dist/components/color-swatch/index.js.map +1 -1
  26. package/dist/index.d.ts +2 -2
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +1 -1
  29. package/dist/index.js.map +1 -1
  30. package/dist/styles/checkbox-group.css +1 -1
  31. package/dist/styles/checkbox-group.css.map +1 -1
  32. package/dist/styles/checkbox.css +1 -1
  33. package/dist/styles/checkbox.css.map +1 -1
  34. package/dist/styles/code-block.css +1 -1
  35. package/dist/styles/code-block.css.map +1 -1
  36. package/dist/styles/color-picker.css +1 -1
  37. package/dist/styles/color-picker.css.map +1 -1
  38. package/dist/styles/color-swatch.css +1 -1
  39. package/dist/styles/color-swatch.css.map +1 -1
  40. package/dist/styles/dropdown-menu.css.map +1 -1
  41. package/dist/styles/menubar.css.map +1 -1
  42. package/dist/styles/popover.css.map +1 -1
  43. package/dist/styles/segment-group.css +1 -1
  44. package/dist/styles/segment-group.css.map +1 -1
  45. package/dist/styles/sidebar.css +1 -1
  46. package/dist/styles/sidebar.css.map +1 -1
  47. package/dist/styles.css +1 -1
  48. package/dist/styles.css.map +1 -1
  49. package/dist/theme-contract.json +139 -2
  50. package/package.json +4 -3
@@ -5,9 +5,10 @@
5
5
  "package": "@flowstack-ui/brick",
6
6
  "layer": "brick",
7
7
  "kind": "component",
8
- "purpose": "Edit, choose, and submit an opaque hexadecimal color through a finished text, native chooser, preset, or optional floating composition.",
8
+ "purpose": "Edit, inspect, choose, and submit one color through a finished popup or inline editor with area, channel, format, preset, native chooser, and EyeDropper paths.",
9
9
  "useWhen": [
10
- "A form needs one #rrggbb color value selected through editable text, the browser chooser, named presets, or a popover that combines them."
10
+ "A form, editor, or settings surface needs one color value with a finished visual editor.",
11
+ "Users need alpha, RGB, HSL, HSB, channel sliders, named presets, or a progressive platform color-picking path."
11
12
  ],
12
13
  "avoidWhen": [
13
14
  {
@@ -15,20 +16,26 @@
15
16
  "useInstead": "Color Swatch"
16
17
  },
17
18
  {
18
- "condition": "The task requires alpha, gradients, color-space conversion, channels, an eyedropper, or contrast analysis.",
19
- "useInstead": "an application-owned specialist until Atom releases that behavior"
19
+ "condition": "The task requires gradients, automatic color naming, contrast scoring, palette persistence, or a color wheel.",
20
+ "useInstead": "application-owned specialist behavior composed around Color Picker"
20
21
  }
21
22
  ],
22
23
  "composition": [
23
24
  "Place Label and Control inside Root; include HiddenInput when the value participates in native form submission.",
24
- "Compose Trigger with Content for a floating picker, or omit both for inline editing.",
25
- "Put ColorSwatch.Root inside Trigger and SwatchTrigger for finished previews while the surrounding control carries the accessible name and selected state."
25
+ "For a popup, compose Trigger, Positioner, and Content. For an always-visible editor, set Root inline and render Content directly.",
26
+ "Build the visual editor from Area, ChannelSlider, format controls, channel inputs, and SwatchGroup; ValueSwatch and ValueText expose the current value.",
27
+ "Place SwatchIndicator inside Swatch or ValueSwatch whenever selection needs a visible non-color cue."
26
28
  ],
27
29
  "rules": [
30
+ {
31
+ "id": "color-picker-ownership",
32
+ "level": "must",
33
+ "statement": "Use Brick parts for the finished interface and keep parsing, format conversion, selection, focus, dismissal, and form state in the exact Atom-backed machine."
34
+ },
28
35
  {
29
36
  "id": "color-picker-label",
30
37
  "level": "must",
31
- "statement": "Give Input and NativeInput accessible names through Label or explicit aria-label values."
38
+ "statement": "Give the primary editable or native input an accessible name through Label or an explicit aria-label."
32
39
  },
33
40
  {
34
41
  "id": "color-picker-form",
@@ -36,37 +43,46 @@
36
43
  "statement": "Provide name to Root and render exactly one HiddenInput when the color must submit."
37
44
  },
38
45
  {
39
- "id": "color-picker-hex",
46
+ "id": "color-picker-popup",
47
+ "level": "must",
48
+ "statement": "Wrap popup Content in Positioner; do not recreate positioning, focus restoration, or outside dismissal."
49
+ },
50
+ {
51
+ "id": "color-picker-selection",
40
52
  "level": "must",
41
- "statement": "Use #rgb or #rrggbb; this release intentionally supports opaque hexadecimal values only."
53
+ "statement": "Name every SwatchTrigger and render SwatchIndicator or an equivalent visible non-color selected cue."
42
54
  },
43
55
  {
44
56
  "id": "color-picker-css",
45
57
  "level": "must",
46
- "statement": "Load styles.css, or core.css plus both color-picker.css and color-swatch.css when swatches are composed."
58
+ "statement": "Load styles.css, or core.css plus color-picker.css for modular delivery."
47
59
  },
48
60
  {
49
- "id": "color-picker-preset-name",
61
+ "id": "color-picker-platform",
50
62
  "level": "should",
51
- "statement": "Give presets human-readable names; do not rely on color alone or a raw hex string when a product name exists."
63
+ "statement": "Treat NativeInput and EyeDropperTrigger as optional platform enhancements, not the only way to edit the color."
52
64
  }
53
65
  ],
54
66
  "commonMistakes": [
55
67
  {
56
- "mistake": "Reimplementing color parsing, picker state, or Popover behavior in Brick or application code.",
57
- "correction": "Use the Atom-backed ColorPicker parts and controlled props."
68
+ "mistake": "Reimplementing color conversion, pointer math, keyboard state, or popup behavior in Brick or application code.",
69
+ "correction": "Compose the released ColorPicker anatomy and controlled callbacks."
70
+ },
71
+ {
72
+ "mistake": "Putting popup Content beside Root without Positioner.",
73
+ "correction": "Use Trigger, Positioner, and Content as the released popup composition."
58
74
  },
59
75
  {
60
- "mistake": "Naming both Input and HiddenInput for form submission.",
76
+ "mistake": "Naming both visible inputs and HiddenInput for submission.",
61
77
  "correction": "Put name on Root and render one HiddenInput."
62
78
  },
63
79
  {
64
- "mistake": "Assuming Chakra's area, alpha, channel, format, or eyedropper parts exist.",
65
- "correction": "Stay within the released Brick anatomy and treat richer behavior as Atom-first future work."
80
+ "mistake": "Using raw color alone to show the selected preset.",
81
+ "correction": "Render SwatchIndicator and an accessible preset name."
66
82
  }
67
83
  ],
68
84
  "validation": [
69
- "Test text, native, preset, controlled, disabled, read-only, invalid, form submit/reset, Escape/focus restoration, light/dark, forced-colors, narrow/zoom, RTL, and non-color selection cues."
85
+ "Test area and channel synchronization, alpha, RGB/HSL/HSB format changes, presets, text/native/EyeDropper paths, controlled state, popup focus and dismissal, disabled/read-only/invalid, form submit/reset, light/dark, forced colors, reduced motion, narrow/zoom, RTL, and non-color selection cues."
70
86
  ],
71
87
  "related": [
72
88
  "color-swatch",
@@ -2,40 +2,45 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- Edit, choose, and submit an opaque hexadecimal color through a finished text, native chooser, preset, or optional floating composition.
5
+ Edit, inspect, choose, and submit one color through a finished popup or inline editor with area, channel, format, preset, native chooser, and EyeDropper paths.
6
6
 
7
7
  ## Use when
8
8
 
9
- - A form needs one #rrggbb color value selected through editable text, the browser chooser, named presets, or a popover that combines them.
9
+ - A form, editor, or settings surface needs one color value with a finished visual editor.
10
+ - Users need alpha, RGB, HSL, HSB, channel sliders, named presets, or a progressive platform color-picking path.
10
11
 
11
12
  ## Choose something else when
12
13
 
13
14
  - The interface only previews a color. Use Color Swatch.
14
- - The task requires alpha, gradients, color-space conversion, channels, an eyedropper, or contrast analysis. Use an application-owned specialist until Atom releases that behavior.
15
+ - The task requires gradients, automatic color naming, contrast scoring, palette persistence, or a color wheel. Use application-owned specialist behavior composed around Color Picker.
15
16
 
16
17
  ## Required composition
17
18
 
18
19
  - Place Label and Control inside Root; include HiddenInput when the value participates in native form submission.
19
- - Compose Trigger with Content for a floating picker, or omit both for inline editing.
20
- - Put ColorSwatch.Root inside Trigger and SwatchTrigger for finished previews while the surrounding control carries the accessible name and selected state.
20
+ - For a popup, compose Trigger, Positioner, and Content. For an always-visible editor, set Root inline and render Content directly.
21
+ - Build the visual editor from Area, ChannelSlider, format controls, channel inputs, and SwatchGroup; ValueSwatch and ValueText expose the current value.
22
+ - Place SwatchIndicator inside Swatch or ValueSwatch whenever selection needs a visible non-color cue.
21
23
 
22
24
  ## Rules
23
25
 
24
- - **MUST:** Give Input and NativeInput accessible names through Label or explicit aria-label values.
26
+ - **MUST:** Use Brick parts for the finished interface and keep parsing, format conversion, selection, focus, dismissal, and form state in the exact Atom-backed machine.
27
+ - **MUST:** Give the primary editable or native input an accessible name through Label or an explicit aria-label.
25
28
  - **MUST:** Provide name to Root and render exactly one HiddenInput when the color must submit.
26
- - **MUST:** Use #rgb or #rrggbb; this release intentionally supports opaque hexadecimal values only.
27
- - **MUST:** Load styles.css, or core.css plus both color-picker.css and color-swatch.css when swatches are composed.
28
- - **SHOULD:** Give presets human-readable names; do not rely on color alone or a raw hex string when a product name exists.
29
+ - **MUST:** Wrap popup Content in Positioner; do not recreate positioning, focus restoration, or outside dismissal.
30
+ - **MUST:** Name every SwatchTrigger and render SwatchIndicator or an equivalent visible non-color selected cue.
31
+ - **MUST:** Load styles.css, or core.css plus color-picker.css for modular delivery.
32
+ - **SHOULD:** Treat NativeInput and EyeDropperTrigger as optional platform enhancements, not the only way to edit the color.
29
33
 
30
34
  ## Common mistakes
31
35
 
32
- - **Avoid:** Reimplementing color parsing, picker state, or Popover behavior in Brick or application code. **Instead:** Use the Atom-backed ColorPicker parts and controlled props.
33
- - **Avoid:** Naming both Input and HiddenInput for form submission. **Instead:** Put name on Root and render one HiddenInput.
34
- - **Avoid:** Assuming Chakra's area, alpha, channel, format, or eyedropper parts exist. **Instead:** Stay within the released Brick anatomy and treat richer behavior as Atom-first future work.
36
+ - **Avoid:** Reimplementing color conversion, pointer math, keyboard state, or popup behavior in Brick or application code. **Instead:** Compose the released ColorPicker anatomy and controlled callbacks.
37
+ - **Avoid:** Putting popup Content beside Root without Positioner. **Instead:** Use Trigger, Positioner, and Content as the released popup composition.
38
+ - **Avoid:** Naming both visible inputs and HiddenInput for submission. **Instead:** Put name on Root and render one HiddenInput.
39
+ - **Avoid:** Using raw color alone to show the selected preset. **Instead:** Render SwatchIndicator and an accessible preset name.
35
40
 
36
41
  ## Validation checklist
37
42
 
38
- - Test text, native, preset, controlled, disabled, read-only, invalid, form submit/reset, Escape/focus restoration, light/dark, forced-colors, narrow/zoom, RTL, and non-color selection cues.
43
+ - Test area and channel synchronization, alpha, RGB/HSL/HSB format changes, presets, text/native/EyeDropper paths, controlled state, popup focus and dismissal, disabled/read-only/invalid, form submit/reset, light/dark, forced colors, reduced motion, narrow/zoom, RTL, and non-color selection cues.
39
44
 
40
45
  ## Related guidance
41
46
 
@@ -5,7 +5,7 @@
5
5
  "package": "@flowstack-ui/brick",
6
6
  "layer": "brick",
7
7
  "kind": "component",
8
- "purpose": "Preview one color or a compact mix of colors with a finished alpha-aware visual treatment.",
8
+ "purpose": "Preview one color or a compact mix of colors with a finished alpha-aware visual treatment and closed shape recipes.",
9
9
  "useWhen": [
10
10
  "A selected, available, saved, or documented color needs a compact visual preview."
11
11
  ],
@@ -16,7 +16,9 @@
16
16
  }
17
17
  ],
18
18
  "composition": [
19
- "Render Root for one color and Mix for two or more colors; place the swatch inside the owning control when it represents a selectable option."
19
+ "Render Root for one color and Mix for two or more colors.",
20
+ "Choose sharp, rounded, or circle through shape rather than application border-radius CSS.",
21
+ "Place the passive swatch inside its owning control when it represents a selectable option."
20
22
  ],
21
23
  "rules": [
22
24
  {
@@ -29,6 +31,11 @@
29
31
  "level": "must",
30
32
  "statement": "Leave decorative swatches unlabeled, or provide label when the swatch itself must be exposed as an image."
31
33
  },
34
+ {
35
+ "id": "color-swatch-shape",
36
+ "level": "should",
37
+ "statement": "Use the closed shape prop for sharp, rounded, or circle geometry before overriding the public radius variable."
38
+ },
32
39
  {
33
40
  "id": "color-swatch-css",
34
41
  "level": "must",
@@ -38,14 +45,19 @@
38
45
  "commonMistakes": [
39
46
  {
40
47
  "mistake": "Adding click handlers directly to ColorSwatch.",
41
- "correction": "Place the passive swatch inside Button, Color Picker preset behavior, or another semantic control."
48
+ "correction": "Place the passive swatch inside Button, Color Picker SwatchTrigger, or another semantic control."
49
+ },
50
+ {
51
+ "mistake": "Using custom border-radius CSS for a standard square or circle.",
52
+ "correction": "Use shape=sharp, rounded, or circle."
42
53
  }
43
54
  ],
44
55
  "validation": [
45
- "Check solid, alpha, mixed, size, light/dark, forced-color, zoom, RTL, and decorative versus labeled semantics."
56
+ "Check solid, alpha, mixed, size, all three shapes, light/dark, forced colors, zoom, RTL, and decorative versus labeled semantics."
46
57
  ],
47
58
  "related": [
59
+ "color-picker",
48
60
  "badge",
49
- "input"
61
+ "button"
50
62
  ]
51
63
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- Preview one color or a compact mix of colors with a finished alpha-aware visual treatment.
5
+ Preview one color or a compact mix of colors with a finished alpha-aware visual treatment and closed shape recipes.
6
6
 
7
7
  ## Use when
8
8
 
@@ -14,23 +14,28 @@ Preview one color or a compact mix of colors with a finished alpha-aware visual
14
14
 
15
15
  ## Required composition
16
16
 
17
- - Render Root for one color and Mix for two or more colors; place the swatch inside the owning control when it represents a selectable option.
17
+ - Render Root for one color and Mix for two or more colors.
18
+ - Choose sharp, rounded, or circle through shape rather than application border-radius CSS.
19
+ - Place the passive swatch inside its owning control when it represents a selectable option.
18
20
 
19
21
  ## Rules
20
22
 
21
23
  - **MUST:** Do not use the swatch as the only carrier of a color name, selection state, validation state, or action.
22
24
  - **MUST:** Leave decorative swatches unlabeled, or provide label when the swatch itself must be exposed as an image.
25
+ - **SHOULD:** Use the closed shape prop for sharp, rounded, or circle geometry before overriding the public radius variable.
23
26
  - **MUST:** Load styles.css or core.css plus color-swatch.css.
24
27
 
25
28
  ## Common mistakes
26
29
 
27
- - **Avoid:** Adding click handlers directly to ColorSwatch. **Instead:** Place the passive swatch inside Button, Color Picker preset behavior, or another semantic control.
30
+ - **Avoid:** Adding click handlers directly to ColorSwatch. **Instead:** Place the passive swatch inside Button, Color Picker SwatchTrigger, or another semantic control.
31
+ - **Avoid:** Using custom border-radius CSS for a standard square or circle. **Instead:** Use shape=sharp, rounded, or circle.
28
32
 
29
33
  ## Validation checklist
30
34
 
31
- - Check solid, alpha, mixed, size, light/dark, forced-color, zoom, RTL, and decorative versus labeled semantics.
35
+ - Check solid, alpha, mixed, size, all three shapes, light/dark, forced colors, zoom, RTL, and decorative versus labeled semantics.
32
36
 
33
37
  ## Related guidance
34
38
 
39
+ - `color-picker`
35
40
  - `badge`
36
- - `input`
41
+ - `button`