@stealthscale/component-actions 0.2.1 → 0.2.3
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/cyclonedx/bom.json +1 -1
- package/dist/index.js +1 -996
- package/dist/pages/button/button.js +323 -0
- package/dist/pages/button/button.props.js +3 -0
- package/dist/pages/clipboard/clipboard.js +400 -0
- package/dist/pages/clipboard/clipboard.props.js +3 -0
- package/dist/pages/color-mode-toggle/color-mode-toggle.js +176 -0
- package/dist/pages/color-mode-toggle/color-mode-toggle.props.js +3 -0
- package/dist/pages/download-trigger/download-trigger.js +401 -0
- package/dist/pages/download-trigger/download-trigger.props.js +3 -0
- package/dist/pages/pages.json +74 -0
- package/dist/pages/swap/swap.js +379 -0
- package/dist/pages/swap/swap.props.js +3 -0
- package/dist/pages/toggle-group/toggle-group.js +326 -0
- package/dist/pages/toggle-group/toggle-group.props.js +3 -0
- package/dist/shared-Dv6Wx5nA.js +997 -0
- package/dist/theme.js +34 -13
- package/locales/en/specimen/button.json +39 -0
- package/locales/en/specimen/clipboard.json +33 -0
- package/locales/en/specimen/color-mode-toggle.json +14 -0
- package/locales/en/specimen/download-trigger.json +34 -0
- package/locales/en/specimen/swap.json +30 -0
- package/locales/en/specimen/toggle-group.json +48 -0
- package/package.json +6 -5
- /package/dist/{recipe-BhcK7PNL.js → recipes-BhcK7PNL.js} +0 -0
package/dist/theme.js
CHANGED
|
@@ -1,14 +1,36 @@
|
|
|
1
|
-
import { n as recipe$1, r as recipe, t as recipe$2 } from "./
|
|
1
|
+
import { n as recipe$1, r as recipe, t as recipe$2 } from "./recipes-BhcK7PNL.js";
|
|
2
2
|
import { definePreset } from "@stealthscale/theme/authoring";
|
|
3
|
-
//#
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
//#endregion
|
|
4
|
+
const theme_default$published = ((preset) => {
|
|
5
|
+
const extend = preset.theme.extend;
|
|
6
|
+
return {
|
|
7
|
+
...preset,
|
|
8
|
+
theme: {
|
|
9
|
+
...preset.theme,
|
|
10
|
+
extend: {
|
|
11
|
+
...extend,
|
|
12
|
+
"recipes": {
|
|
13
|
+
...extend["recipes"],
|
|
14
|
+
"button": {
|
|
15
|
+
...extend["recipes"]["button"],
|
|
16
|
+
staticCss: [...extend["recipes"]["button"].staticCss ?? [], {
|
|
17
|
+
"palette": ["neutral"],
|
|
18
|
+
"shape": ["square"],
|
|
19
|
+
"variant": ["ghost"]
|
|
20
|
+
}]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"slotRecipes": {
|
|
24
|
+
...extend["slotRecipes"],
|
|
25
|
+
"swap": {
|
|
26
|
+
...extend["slotRecipes"]["swap"],
|
|
27
|
+
staticCss: [...extend["slotRecipes"]["swap"].staticCss ?? []]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
})(definePreset({
|
|
12
34
|
name: "@stealthscale/component-actions",
|
|
13
35
|
theme: { extend: {
|
|
14
36
|
recipes: { button: recipe },
|
|
@@ -17,6 +39,5 @@ var theme_default = definePreset({
|
|
|
17
39
|
swap: recipe$2
|
|
18
40
|
}
|
|
19
41
|
} }
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
export { theme_default as default };
|
|
42
|
+
}));
|
|
43
|
+
export { theme_default$published as default };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"about": "A control that runs an action when pressed, and a square variant that holds one icon.",
|
|
3
|
+
"approve": "Approve",
|
|
4
|
+
"archive": "Archive",
|
|
5
|
+
"bold": "Bold",
|
|
6
|
+
"celebrate": "Celebrate",
|
|
7
|
+
"disabled": {
|
|
8
|
+
"about": "A disabled button keeps its size in every look and ignores presses.",
|
|
9
|
+
"title": "Disabled"
|
|
10
|
+
},
|
|
11
|
+
"effect": {
|
|
12
|
+
"about": "A halo in the palette's solid at half opacity. `glow` holds still and `pulse` breathes. Every button also runs a ripple from the press point without an effect set.",
|
|
13
|
+
"title": "Effects"
|
|
14
|
+
},
|
|
15
|
+
"elevation": {
|
|
16
|
+
"about": "A raised button lifts under the pointer and drops back towards the page when pressed.",
|
|
17
|
+
"title": "Elevation"
|
|
18
|
+
},
|
|
19
|
+
"palette": {
|
|
20
|
+
"about": "The eight semantic palettes in every look. A palette sets the colors a look reads, so a theme moves every button that uses it.",
|
|
21
|
+
"title": "Palettes"
|
|
22
|
+
},
|
|
23
|
+
"pressed": {
|
|
24
|
+
"about": "A toggle is a button with `aria-pressed`. The recipe fills it while the attribute is true, so the fill matches what a screen reader announces.",
|
|
25
|
+
"title": "Pressed"
|
|
26
|
+
},
|
|
27
|
+
"publish": "Publish",
|
|
28
|
+
"retry": "Retry",
|
|
29
|
+
"shape": {
|
|
30
|
+
"about": "The square shape holds one icon. `IconButton` sets it by default and requires an accessible name.",
|
|
31
|
+
"title": "Square"
|
|
32
|
+
},
|
|
33
|
+
"title": "Button",
|
|
34
|
+
"upload": "Upload",
|
|
35
|
+
"variant": {
|
|
36
|
+
"about": "Every shared look plus `glass`, at every size. A look reads the palette, so a palette or a theme moves every look at once.",
|
|
37
|
+
"title": "Looks and sizes"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"about": "Copies a value to the clipboard and shows the copied state for a moment. The trigger has no styles of its own, so a page renders it as a `Button` or an `IconButton`.",
|
|
3
|
+
"alone": {
|
|
4
|
+
"about": "A button with visible text that copies the link. During the copied state the icon becomes a check mark and the text becomes `copiedLabel`. `label` and `copiedLabel` repeat the visible text, so the accessible name contains the label in both states.",
|
|
5
|
+
"title": "Copy button"
|
|
6
|
+
},
|
|
7
|
+
"beside": {
|
|
8
|
+
"about": "An icon button next to a read-only field. The field is focusable and selectable, so a person can copy by hand when the browser denies clipboard access.",
|
|
9
|
+
"title": "Beside a field"
|
|
10
|
+
},
|
|
11
|
+
"copied": "Copied",
|
|
12
|
+
"copiedValue": "Copied {{value}}",
|
|
13
|
+
"copy": "Copy the link",
|
|
14
|
+
"copyValue": "Copy {{value}}",
|
|
15
|
+
"held": {
|
|
16
|
+
"about": "`timeout` sets the duration of the copied state in milliseconds. The default is 3000. Press both buttons to compare 250 and 3000.",
|
|
17
|
+
"title": "Copied-state duration"
|
|
18
|
+
},
|
|
19
|
+
"label": "Link to the payout",
|
|
20
|
+
"own": {
|
|
21
|
+
"about": "A button the page builds with `Clipboard.Consumer`, which reads `copied` and calls `copy`. Use it when the control is not a plain button or its text changes with the state.",
|
|
22
|
+
"title": "Custom control"
|
|
23
|
+
},
|
|
24
|
+
"size": {
|
|
25
|
+
"about": "The labelled row at each size. The root size sets the label and the gaps. The field and the button take the same size through their providers.",
|
|
26
|
+
"title": "Sizes"
|
|
27
|
+
},
|
|
28
|
+
"title": "Clipboard",
|
|
29
|
+
"value": {
|
|
30
|
+
"about": "The value is the button text. `label` and `copiedLabel` name the action and the value, so the accessible name contains the visible text.",
|
|
31
|
+
"title": "Value as the trigger"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"about": "A color mode toggle switches the page between light and dark. It reads the mode the page is drawn in, so while the choice follows the operating system it shows the mode the system chose, and a press stores the other mode. It keeps one name and reports dark as pressed. Every toggle on this page switches the catalogue itself.",
|
|
3
|
+
"header": {
|
|
4
|
+
"about": "The toggle at the end of an application's header, ghost and neutral as a control in a bar is.",
|
|
5
|
+
"product": "Ledger",
|
|
6
|
+
"title": "In a header"
|
|
7
|
+
},
|
|
8
|
+
"label": "Dark mode",
|
|
9
|
+
"looks": {
|
|
10
|
+
"about": "Every button prop passes through, so a toolbar sets the look it uses for its other controls.",
|
|
11
|
+
"title": "Looks"
|
|
12
|
+
},
|
|
13
|
+
"title": "Color mode toggle"
|
|
14
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"about": "Saves a file built in the page, such as an export of the records on screen. The trigger is the library's `Button`, so it takes every button axis. The contents of the file come from the page itself.",
|
|
3
|
+
"built": {
|
|
4
|
+
"about": "`data` is a function the trigger calls on each press. This one compresses 20,000 rows with gzip and returns a promise of the file. While the promise is pending, a spinning `Icon` named Compressing replaces the download icon. The trigger is `aria-disabled` in that state, so it keeps focus, and its `onClick` cancels a second press with `preventDefault`.",
|
|
5
|
+
"title": "Built on press"
|
|
6
|
+
},
|
|
7
|
+
"compressing": "Compressing",
|
|
8
|
+
"download": "Download",
|
|
9
|
+
"export": "Export",
|
|
10
|
+
"exports": "Exports for September",
|
|
11
|
+
"file": "File",
|
|
12
|
+
"formats": {
|
|
13
|
+
"csv": "Spreadsheet (CSV)",
|
|
14
|
+
"json": "Data (JSON)",
|
|
15
|
+
"markdown": "Table (Markdown)"
|
|
16
|
+
},
|
|
17
|
+
"kinds": {
|
|
18
|
+
"about": "A CSV ledger, JSON totals and an SVG mark, each saved under its own name and `mimeType`. An icon-only trigger takes `aria-label` and `shape=\"square\"`. The size column reads the byte length of each file.",
|
|
19
|
+
"title": "Kinds of file"
|
|
20
|
+
},
|
|
21
|
+
"ledger": "Download the ledger",
|
|
22
|
+
"lone": {
|
|
23
|
+
"about": "A trigger with visible text saves the ledger as a CSV file. `data` is text in the page, and `mimeType` gives it a type.",
|
|
24
|
+
"title": "Download button"
|
|
25
|
+
},
|
|
26
|
+
"menu": {
|
|
27
|
+
"about": "A menu row is not a button, so the menu's `onSelect` calls `download` with the chosen format. `download` takes the trigger's options and returns a promise.",
|
|
28
|
+
"title": "From a menu"
|
|
29
|
+
},
|
|
30
|
+
"payouts": "Download all payouts",
|
|
31
|
+
"save": "Download {{file}}",
|
|
32
|
+
"size": "Size",
|
|
33
|
+
"title": "Download trigger"
|
|
34
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"about": "A swap puts two marks in one place and shows one of them. When the control around it changes state, one mark leaves while the other enters. Both marks keep their room, so the swap is as large as the larger mark and nothing beside it moves. The swap has no role of its own: the button around it names the state.",
|
|
3
|
+
"follow": {
|
|
4
|
+
"about": "Words swap as well as icons. The button is as wide as Unfollow in both states, and its name is the action a press takes, so it sets no aria-pressed.",
|
|
5
|
+
"follow": "Follow",
|
|
6
|
+
"person": "Ada Lovelace",
|
|
7
|
+
"title": "Words",
|
|
8
|
+
"unfollow": "Unfollow"
|
|
9
|
+
},
|
|
10
|
+
"motion": {
|
|
11
|
+
"about": "Motion sets how one mark replaces the other: scaled, faded, rolled up, or at once. Press a button to watch it. Under reduced motion every swap changes at once.",
|
|
12
|
+
"title": "Motions"
|
|
13
|
+
},
|
|
14
|
+
"mute": {
|
|
15
|
+
"about": "A toggle button keeps one name, Mute, and reports its state as pressed. The swap shows the speaker with sound or crossed out.",
|
|
16
|
+
"label": "Mute",
|
|
17
|
+
"title": "Toggle button"
|
|
18
|
+
},
|
|
19
|
+
"playback": {
|
|
20
|
+
"about": "The button's name is the action a press takes, Play or Pause, and the mark follows it.",
|
|
21
|
+
"pause": "Pause",
|
|
22
|
+
"play": "Play",
|
|
23
|
+
"title": "Named by the action"
|
|
24
|
+
},
|
|
25
|
+
"states": {
|
|
26
|
+
"about": "The off mark shows while swap is false and the on mark while it is true.",
|
|
27
|
+
"title": "States"
|
|
28
|
+
},
|
|
29
|
+
"title": "Swap"
|
|
30
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"about": "Renders buttons that stay pressed: one at a time, as a choice, or several at once, as a set of toggles. The arrow keys move between the buttons, and Space and Enter toggle the focused one.",
|
|
3
|
+
"align": "Text alignment",
|
|
4
|
+
"alignments": {
|
|
5
|
+
"center": "Center",
|
|
6
|
+
"left": "Left",
|
|
7
|
+
"right": "Right"
|
|
8
|
+
},
|
|
9
|
+
"looks": {
|
|
10
|
+
"about": "The button's looks, as one attached strip. A button that is on takes its look's pressed fill, one step deeper than the look's rest. The `solid` look marks a pressed button with an inset shadow and a semibold label, which an icon does not show.",
|
|
11
|
+
"title": "Looks"
|
|
12
|
+
},
|
|
13
|
+
"orientation": {
|
|
14
|
+
"about": "`orientation=\"vertical\"` stacks the buttons, and the up and down arrow keys move between them.",
|
|
15
|
+
"title": "Orientation"
|
|
16
|
+
},
|
|
17
|
+
"show": "Show invoices",
|
|
18
|
+
"single": {
|
|
19
|
+
"about": "Without `multiple` the group keeps one button on and reads as a set of radios. `deselectable={false}` keeps a button on when it is pressed again.",
|
|
20
|
+
"title": "One at a time"
|
|
21
|
+
},
|
|
22
|
+
"sizes": {
|
|
23
|
+
"about": "The button's sizes, so a group in a toolbar is as tall as the buttons beside it.",
|
|
24
|
+
"title": "Sizes"
|
|
25
|
+
},
|
|
26
|
+
"spaced": {
|
|
27
|
+
"about": "`attached={false}` spaces the buttons by the group's gap. Archived is disabled, and the arrow keys skip it.",
|
|
28
|
+
"title": "Spaced"
|
|
29
|
+
},
|
|
30
|
+
"states": {
|
|
31
|
+
"about": "A disabled group dims every button and takes none out of the row.",
|
|
32
|
+
"title": "Disabled"
|
|
33
|
+
},
|
|
34
|
+
"statuses": {
|
|
35
|
+
"archived": "Archived",
|
|
36
|
+
"open": "Open",
|
|
37
|
+
"paid": "Paid",
|
|
38
|
+
"pending": "Pending"
|
|
39
|
+
},
|
|
40
|
+
"style": "Text style",
|
|
41
|
+
"styles": {
|
|
42
|
+
"bold": "Bold",
|
|
43
|
+
"italic": "Italic",
|
|
44
|
+
"strikethrough": "Strikethrough",
|
|
45
|
+
"underline": "Underline"
|
|
46
|
+
},
|
|
47
|
+
"title": "Toggle group"
|
|
48
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stealthscale/component-actions",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Renders what a person presses: a button, a toggle group, a swap, a color mode toggle, a clipboard and a download trigger.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"actions",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"files": [
|
|
20
20
|
"dist",
|
|
21
21
|
"LICENSE",
|
|
22
|
+
"locales",
|
|
22
23
|
"README.md"
|
|
23
24
|
],
|
|
24
25
|
"type": "module",
|
|
@@ -35,7 +36,7 @@
|
|
|
35
36
|
"access": "public"
|
|
36
37
|
},
|
|
37
38
|
"dependencies": {
|
|
38
|
-
"@stealthscale/component-layout": "^0.2.
|
|
39
|
+
"@stealthscale/component-layout": "^0.2.2",
|
|
39
40
|
"@zag-js/clipboard": "1.45.0",
|
|
40
41
|
"@zag-js/file-utils": "1.45.0",
|
|
41
42
|
"@zag-js/react": "1.45.0",
|
|
@@ -50,10 +51,10 @@
|
|
|
50
51
|
"@stealthscale/settings": "^0.2.0",
|
|
51
52
|
"@stealthscale/theme": "^0.5.0",
|
|
52
53
|
"@stealthscale/vite-config": "^0.8.0",
|
|
53
|
-
"@stealthscale/vite-config-i18n": "^0.2.
|
|
54
|
+
"@stealthscale/vite-config-i18n": "^0.2.2",
|
|
54
55
|
"@stealthscale/vite-config-react": "^0.9.1",
|
|
55
|
-
"@stealthscale/vite-config-specimen": "^0.
|
|
56
|
-
"@stealthscale/vite-config-theme": "^0.
|
|
56
|
+
"@stealthscale/vite-config-specimen": "^0.3.0",
|
|
57
|
+
"@stealthscale/vite-config-theme": "^0.3.0",
|
|
57
58
|
"@stealthscale/vite-config-typescript": "^0.3.0",
|
|
58
59
|
"@testing-library/react": "^16.3",
|
|
59
60
|
"@types/react": "^19.3",
|
|
File without changes
|