@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.
- package/dist/agents/color-picker.json +34 -18
- package/dist/agents/color-picker.md +18 -13
- package/dist/agents/color-swatch.json +17 -5
- package/dist/agents/color-swatch.md +10 -5
- package/dist/agents/coverage.json +1874 -1165
- package/dist/agents/manifest.json +1 -1
- package/dist/components/code-block/CodeBlock.d.ts +6 -3
- package/dist/components/code-block/CodeBlock.d.ts.map +1 -1
- package/dist/components/code-block/CodeBlock.js +19 -9
- package/dist/components/code-block/CodeBlock.js.map +1 -1
- package/dist/components/color-picker/ColorPicker.d.ts +83 -24
- package/dist/components/color-picker/ColorPicker.d.ts.map +1 -1
- package/dist/components/color-picker/ColorPicker.js +102 -10
- package/dist/components/color-picker/ColorPicker.js.map +1 -1
- package/dist/components/color-picker/index.d.ts +1 -1
- package/dist/components/color-picker/index.d.ts.map +1 -1
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/color-picker/index.js.map +1 -1
- package/dist/components/color-swatch/ColorSwatch.d.ts +3 -0
- package/dist/components/color-swatch/ColorSwatch.d.ts.map +1 -1
- package/dist/components/color-swatch/ColorSwatch.js +4 -4
- package/dist/components/color-swatch/ColorSwatch.js.map +1 -1
- package/dist/components/color-swatch/index.d.ts +1 -1
- package/dist/components/color-swatch/index.d.ts.map +1 -1
- package/dist/components/color-swatch/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/styles/checkbox-group.css +1 -1
- package/dist/styles/checkbox-group.css.map +1 -1
- package/dist/styles/checkbox.css +1 -1
- package/dist/styles/checkbox.css.map +1 -1
- package/dist/styles/code-block.css +1 -1
- package/dist/styles/code-block.css.map +1 -1
- package/dist/styles/color-picker.css +1 -1
- package/dist/styles/color-picker.css.map +1 -1
- package/dist/styles/color-swatch.css +1 -1
- package/dist/styles/color-swatch.css.map +1 -1
- package/dist/styles/dropdown-menu.css.map +1 -1
- package/dist/styles/menubar.css.map +1 -1
- package/dist/styles/popover.css.map +1 -1
- package/dist/styles/segment-group.css +1 -1
- package/dist/styles/segment-group.css.map +1 -1
- package/dist/styles/sidebar.css +1 -1
- package/dist/styles/sidebar.css.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/dist/theme-contract.json +139 -2
- 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
|
|
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
|
|
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
|
|
19
|
-
"useInstead": "
|
|
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
|
-
"
|
|
25
|
-
"
|
|
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
|
|
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-
|
|
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": "
|
|
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
|
|
58
|
+
"statement": "Load styles.css, or core.css plus color-picker.css for modular delivery."
|
|
47
59
|
},
|
|
48
60
|
{
|
|
49
|
-
"id": "color-picker-
|
|
61
|
+
"id": "color-picker-platform",
|
|
50
62
|
"level": "should",
|
|
51
|
-
"statement": "
|
|
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
|
|
57
|
-
"correction": "
|
|
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
|
|
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": "
|
|
65
|
-
"correction": "
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
-
|
|
20
|
-
-
|
|
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:**
|
|
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:**
|
|
27
|
-
- **MUST:**
|
|
28
|
-
- **
|
|
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
|
|
33
|
-
- **Avoid:**
|
|
34
|
-
- **Avoid:**
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
"
|
|
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
|
|
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
|
|
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
|
|
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
|
-
- `
|
|
41
|
+
- `button`
|