@calcifer-design/ui 0.2.1 → 0.4.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/dist/components/Alert/Alert.js +4 -15
  2. package/dist/components/Alert/Alert.module.js +1 -2
  3. package/dist/components/Alert/Alert_module.css +0 -12
  4. package/dist/components/Avatar/Avatar.js +2 -1
  5. package/dist/components/Avatar/Avatar.module.js +1 -2
  6. package/dist/components/Avatar/Avatar_module.css +0 -12
  7. package/dist/components/Checkbox/Checkbox.d.ts +23 -0
  8. package/dist/components/Checkbox/Checkbox.js +33 -0
  9. package/dist/components/Checkbox/Checkbox.module.js +6 -0
  10. package/dist/components/Checkbox/Checkbox_module.css +16 -0
  11. package/dist/components/DataTable/DataTable.js +7 -2
  12. package/dist/components/DataTable/DataTable_module.css +0 -16
  13. package/dist/components/Dialog/Dialog.d.ts +44 -0
  14. package/dist/components/Dialog/Dialog.js +82 -0
  15. package/dist/components/Dialog/Dialog.module.js +10 -0
  16. package/dist/components/Dialog/Dialog_module.css +51 -0
  17. package/dist/components/Field/Field.d.ts +118 -0
  18. package/dist/components/Field/Field.js +84 -0
  19. package/dist/components/LiveRegion/LiveRegion.js +2 -2
  20. package/dist/components/Menu/Menu.d.ts +35 -0
  21. package/dist/components/Menu/Menu.js +44 -0
  22. package/dist/components/Menu/Menu.module.js +6 -0
  23. package/dist/components/Menu/Menu_module.css +29 -0
  24. package/dist/components/NavMenu/NavMenu.js +4 -2
  25. package/dist/components/NavMenu/NavMenu.module.js +0 -2
  26. package/dist/components/NavMenu/NavMenu_module.css +0 -15
  27. package/dist/components/Popover/Popover.d.ts +42 -0
  28. package/dist/components/Popover/Popover.js +61 -0
  29. package/dist/components/Popover/Popover.module.js +6 -0
  30. package/dist/components/Popover/Popover_module.css +13 -0
  31. package/dist/components/RadioGroup/RadioGroup.d.ts +35 -0
  32. package/dist/components/RadioGroup/RadioGroup.js +64 -0
  33. package/dist/components/RadioGroup/RadioGroup.module.js +6 -0
  34. package/dist/components/RadioGroup/RadioGroup_module.css +13 -0
  35. package/dist/components/Select/Select.d.ts +42 -0
  36. package/dist/components/Select/Select.js +90 -0
  37. package/dist/components/Select/Select.module.js +9 -0
  38. package/dist/components/Select/Select_module.css +70 -0
  39. package/dist/components/Spinner/Spinner.js +2 -1
  40. package/dist/components/Spinner/Spinner.module.js +1 -2
  41. package/dist/components/Spinner/Spinner_module.css +0 -12
  42. package/dist/components/StatusDot/StatusDot.js +6 -1
  43. package/dist/components/StatusDot/StatusDot_module.css +0 -12
  44. package/dist/components/Switch/Switch.d.ts +23 -0
  45. package/dist/components/Switch/Switch.js +25 -0
  46. package/dist/components/Switch/Switch.module.js +6 -0
  47. package/dist/components/Switch/Switch_module.css +41 -0
  48. package/dist/components/TextInput/TextInput.d.ts +17 -0
  49. package/dist/components/TextInput/TextInput.js +18 -0
  50. package/dist/components/ToastRegion/ToastRegion.d.ts +72 -0
  51. package/dist/components/ToastRegion/ToastRegion.js +85 -0
  52. package/dist/components/ToastRegion/ToastRegion.module.js +10 -0
  53. package/dist/components/ToastRegion/ToastRegion_module.css +104 -0
  54. package/dist/components/Tooltip/Tooltip.d.ts +33 -0
  55. package/dist/components/Tooltip/Tooltip.js +28 -0
  56. package/dist/components/Tooltip/TooltipProvider.d.ts +24 -0
  57. package/dist/components/Tooltip/TooltipProvider.js +11 -0
  58. package/dist/icons/CheckIcon.d.ts +6 -0
  59. package/dist/icons/CheckIcon.js +17 -0
  60. package/dist/icons/ChevronDownIcon.d.ts +6 -0
  61. package/dist/icons/ChevronDownIcon.js +17 -0
  62. package/dist/icons/CloseIcon.d.ts +10 -0
  63. package/dist/icons/CloseIcon.js +21 -0
  64. package/dist/icons/MinusIcon.d.ts +5 -0
  65. package/dist/icons/MinusIcon.js +16 -0
  66. package/dist/index.d.ts +24 -0
  67. package/dist/index.js +12 -0
  68. package/dist/styles/a11y.module.js +5 -0
  69. package/dist/{components/LiveRegion/LiveRegion_module.css → styles/a11y_module.css} +1 -1
  70. package/dist/styles/field.module.js +15 -0
  71. package/dist/styles/field_module.css +133 -0
  72. package/dist/styles/popup.module.js +9 -0
  73. package/dist/styles/popup_module.css +109 -0
  74. package/package.json +2 -2
  75. package/dist/components/LiveRegion/LiveRegion.module.js +0 -5
@@ -0,0 +1,21 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ function CloseIcon() {
3
+ return /*#__PURE__*/ jsxs("svg", {
4
+ viewBox: "0 0 16 16",
5
+ fill: "none",
6
+ stroke: "currentColor",
7
+ strokeWidth: "1.5",
8
+ strokeLinecap: "round",
9
+ "aria-hidden": "true",
10
+ focusable: "false",
11
+ children: [
12
+ /*#__PURE__*/ jsx("path", {
13
+ d: "m4.5 4.5 7 7"
14
+ }),
15
+ /*#__PURE__*/ jsx("path", {
16
+ d: "m11.5 4.5-7 7"
17
+ })
18
+ ]
19
+ });
20
+ }
21
+ export { CloseIcon };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * The bar inside an indeterminate `Checkbox`. Internal, like the library's other icons; the
3
+ * checkbox's own `aria-checked="mixed"` carries the state, so this is decorative.
4
+ */
5
+ export declare function MinusIcon(): import("react").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ function MinusIcon() {
3
+ return /*#__PURE__*/ jsx("svg", {
4
+ viewBox: "0 0 16 16",
5
+ fill: "none",
6
+ stroke: "currentColor",
7
+ strokeWidth: "2",
8
+ strokeLinecap: "round",
9
+ "aria-hidden": "true",
10
+ focusable: "false",
11
+ children: /*#__PURE__*/ jsx("path", {
12
+ d: "M4 8h8"
13
+ })
14
+ });
15
+ }
16
+ export { MinusIcon };
package/dist/index.d.ts CHANGED
@@ -33,3 +33,27 @@ export { Avatar } from './components/Avatar/Avatar.js';
33
33
  export type { AvatarProps } from './components/Avatar/Avatar.js';
34
34
  export { ErrorBoundary } from './components/ErrorBoundary/ErrorBoundary.js';
35
35
  export type { ErrorBoundaryProps, ErrorBoundaryFallbackDetails, } from './components/ErrorBoundary/ErrorBoundary.js';
36
+ export { Popover } from './components/Popover/Popover.js';
37
+ export type { PopoverProps, PopupSide, PopupAlign } from './components/Popover/Popover.js';
38
+ export { Dialog } from './components/Dialog/Dialog.js';
39
+ export type { DialogProps, DialogVariant, SheetSide } from './components/Dialog/Dialog.js';
40
+ export { Menu } from './components/Menu/Menu.js';
41
+ export type { MenuProps, MenuItem } from './components/Menu/Menu.js';
42
+ export { Tooltip } from './components/Tooltip/Tooltip.js';
43
+ export type { TooltipProps } from './components/Tooltip/Tooltip.js';
44
+ export { TooltipProvider, TOOLTIP_DELAY } from './components/Tooltip/TooltipProvider.js';
45
+ export type { TooltipProviderProps } from './components/Tooltip/TooltipProvider.js';
46
+ export { ToastRegion, createToastManager } from './components/ToastRegion/ToastRegion.js';
47
+ export type { ToastRegionProps, ToastManager, ToastOptions, ToastTone, ToastAction, } from './components/ToastRegion/ToastRegion.js';
48
+ export { Field } from './components/Field/Field.js';
49
+ export type { FieldProps } from './components/Field/Field.js';
50
+ export { TextInput } from './components/TextInput/TextInput.js';
51
+ export type { TextInputProps, TextInputType } from './components/TextInput/TextInput.js';
52
+ export { Select } from './components/Select/Select.js';
53
+ export type { SelectProps, SelectOption } from './components/Select/Select.js';
54
+ export { Checkbox } from './components/Checkbox/Checkbox.js';
55
+ export type { CheckboxProps } from './components/Checkbox/Checkbox.js';
56
+ export { RadioGroup } from './components/RadioGroup/RadioGroup.js';
57
+ export type { RadioGroupProps, RadioOption } from './components/RadioGroup/RadioGroup.js';
58
+ export { Switch } from './components/Switch/Switch.js';
59
+ export type { SwitchProps } from './components/Switch/Switch.js';
package/dist/index.js CHANGED
@@ -16,3 +16,15 @@ export { IconButton } from "./components/IconButton/IconButton.js";
16
16
  export { Alert } from "./components/Alert/Alert.js";
17
17
  export { Avatar } from "./components/Avatar/Avatar.js";
18
18
  export { ErrorBoundary } from "./components/ErrorBoundary/ErrorBoundary.js";
19
+ export { Popover } from "./components/Popover/Popover.js";
20
+ export { Dialog } from "./components/Dialog/Dialog.js";
21
+ export { Menu } from "./components/Menu/Menu.js";
22
+ export { Tooltip } from "./components/Tooltip/Tooltip.js";
23
+ export { TOOLTIP_DELAY, TooltipProvider } from "./components/Tooltip/TooltipProvider.js";
24
+ export { ToastRegion, createToastManager } from "./components/ToastRegion/ToastRegion.js";
25
+ export { Field } from "./components/Field/Field.js";
26
+ export { TextInput } from "./components/TextInput/TextInput.js";
27
+ export { Select } from "./components/Select/Select.js";
28
+ export { Checkbox } from "./components/Checkbox/Checkbox.js";
29
+ export { RadioGroup } from "./components/RadioGroup/RadioGroup.js";
30
+ export { Switch } from "./components/Switch/Switch.js";
@@ -0,0 +1,5 @@
1
+ import "./a11y_module.css";
2
+ const a11y_module = {
3
+ visuallyHidden: "visuallyHidden-mBQuJ"
4
+ };
5
+ export default a11y_module;
@@ -1,4 +1,4 @@
1
- .root-queRh {
1
+ .visuallyHidden-mBQuJ {
2
2
  clip-path: inset(50%);
3
3
  white-space: nowrap;
4
4
  border: 0;
@@ -0,0 +1,15 @@
1
+ import "./field_module.css";
2
+ const field_module = {
3
+ frame: "frame-J0Ojt",
4
+ inlineFrame: "inlineFrame-zSCRB",
5
+ label: "label-biJfU",
6
+ legend: "legend-de1mj",
7
+ required: "required-Gk1aH",
8
+ optionLabel: "optionLabel-iP92d",
9
+ options: "options-hWZ0_",
10
+ description: "description-nT8MY",
11
+ error: "error-WHv_B",
12
+ control: "control-Hqf8o",
13
+ controlBox: "controlBox-m9xtL"
14
+ };
15
+ export default field_module;
@@ -0,0 +1,133 @@
1
+ .frame-J0Ojt, .inlineFrame-zSCRB {
2
+ gap: var(--space-2);
3
+ flex-direction: column;
4
+ display: flex;
5
+ }
6
+
7
+ .inlineFrame-zSCRB {
8
+ gap: var(--space-1);
9
+ }
10
+
11
+ .label-biJfU, .legend-de1mj {
12
+ align-items: center;
13
+ gap: var(--space-1);
14
+ color: var(--color-text);
15
+ font-size: var(--text-sm);
16
+ font-weight: 500;
17
+ line-height: var(--leading-snug);
18
+ display: flex;
19
+ }
20
+
21
+ .label-biJfU[data-disabled], .legend-de1mj[data-disabled] {
22
+ color: var(--color-text-muted);
23
+ }
24
+
25
+ .required-Gk1aH {
26
+ color: var(--color-danger);
27
+ }
28
+
29
+ .required-Gk1aH:after {
30
+ content: "*";
31
+ }
32
+
33
+ .optionLabel-iP92d {
34
+ align-items: center;
35
+ gap: var(--space-3);
36
+ color: var(--color-text);
37
+ font-size: var(--text-md);
38
+ line-height: var(--leading-snug);
39
+ cursor: pointer;
40
+ display: flex;
41
+ }
42
+
43
+ .optionLabel-iP92d[data-disabled] {
44
+ cursor: not-allowed;
45
+ color: var(--color-text-muted);
46
+ }
47
+
48
+ .options-hWZ0_ {
49
+ gap: var(--space-2);
50
+ flex-direction: column;
51
+ display: flex;
52
+ }
53
+
54
+ .options-hWZ0_[data-orientation="horizontal"] {
55
+ gap: var(--space-4);
56
+ flex-flow: wrap;
57
+ }
58
+
59
+ .description-nT8MY {
60
+ color: var(--color-text-muted);
61
+ font-size: var(--text-sm);
62
+ line-height: var(--leading-prose);
63
+ margin: 0;
64
+ }
65
+
66
+ .error-WHv_B {
67
+ color: var(--color-danger);
68
+ font-size: var(--text-sm);
69
+ line-height: var(--leading-snug);
70
+ }
71
+
72
+ .control-Hqf8o {
73
+ width: 100%;
74
+ min-height: var(--size-touch);
75
+ padding: var(--space-2) var(--space-3);
76
+ border: 1px solid var(--color-border-strong);
77
+ border-radius: var(--radius-md);
78
+ background: var(--color-surface-input);
79
+ color: var(--color-text);
80
+ font-size: var(--text-md);
81
+ line-height: var(--leading-snug);
82
+ transition-property: border-color, background-color;
83
+ transition-duration: var(--motion-duration-1);
84
+ transition-timing-function: var(--motion-ease);
85
+ align-items: center;
86
+ display: flex;
87
+ }
88
+
89
+ .control-Hqf8o::placeholder {
90
+ color: var(--color-text-subtle);
91
+ }
92
+
93
+ .control-Hqf8o:focus-visible {
94
+ border-color: var(--color-accent);
95
+ }
96
+
97
+ .control-Hqf8o[data-invalid] {
98
+ border-color: var(--color-danger-border);
99
+ background: var(--color-danger-surface);
100
+ }
101
+
102
+ .control-Hqf8o[data-disabled] {
103
+ cursor: not-allowed;
104
+ opacity: .55;
105
+ }
106
+
107
+ .controlBox-m9xtL {
108
+ border: 1px solid var(--color-border-strong);
109
+ background: var(--color-surface-input);
110
+ cursor: pointer;
111
+ transition-property: background-color, border-color;
112
+ transition-duration: var(--motion-duration-1);
113
+ transition-timing-function: var(--motion-ease);
114
+ flex: none;
115
+ justify-content: center;
116
+ align-items: center;
117
+ display: inline-flex;
118
+ }
119
+
120
+ .controlBox-m9xtL[data-checked], .controlBox-m9xtL[data-indeterminate] {
121
+ border-color: var(--color-accent);
122
+ background: var(--color-accent);
123
+ }
124
+
125
+ .controlBox-m9xtL[data-invalid] {
126
+ border-color: var(--color-danger-border);
127
+ }
128
+
129
+ .controlBox-m9xtL[data-disabled] {
130
+ cursor: not-allowed;
131
+ opacity: .55;
132
+ }
133
+
@@ -0,0 +1,9 @@
1
+ import "./popup_module.css";
2
+ const popup_module = {
3
+ layer: "layer-l8dxw",
4
+ dialogLayer: "dialogLayer-lHsEi",
5
+ toastLayer: "toastLayer-A8Jfk",
6
+ surface: "surface-_qTRv",
7
+ scrim: "scrim-HnQwr"
8
+ };
9
+ export default popup_module;
@@ -0,0 +1,109 @@
1
+ .layer-l8dxw, .dialogLayer-lHsEi {
2
+ z-index: 50;
3
+ }
4
+
5
+ .toastLayer-A8Jfk {
6
+ z-index: 70;
7
+ }
8
+
9
+ .surface-_qTRv {
10
+ gap: var(--space-2);
11
+ max-width: var(--available-width);
12
+ max-height: var(--available-height);
13
+ padding: var(--space-2);
14
+ overscroll-behavior: contain;
15
+ border: 1px solid var(--color-border);
16
+ border-radius: var(--radius-lg);
17
+ background: var(--color-surface-raised);
18
+ color: var(--color-text);
19
+ box-shadow: var(--elevation-2);
20
+ transform-origin: var(--transform-origin);
21
+ transition-property: opacity, transform;
22
+ transition-duration: var(--motion-duration-2);
23
+ transition-timing-function: var(--motion-ease);
24
+ flex-direction: column;
25
+ display: flex;
26
+ overflow-y: auto;
27
+ }
28
+
29
+ .surface-_qTRv[data-popup="popover"] {
30
+ gap: var(--space-3);
31
+ min-width: 14rem;
32
+ padding: var(--space-4);
33
+ }
34
+
35
+ .surface-_qTRv[data-popup="menu"] {
36
+ gap: 0;
37
+ min-width: 12rem;
38
+ }
39
+
40
+ .surface-_qTRv[data-popup="tooltip"] {
41
+ max-width: min(18rem, var(--available-width));
42
+ padding: var(--space-2) var(--space-3);
43
+ font-size: var(--text-sm);
44
+ }
45
+
46
+ .surface-_qTRv[data-popup="dialog"] {
47
+ gap: var(--space-4);
48
+ width: min(32rem, 100%);
49
+ max-width: 100%;
50
+ max-height: 85dvh;
51
+ padding: var(--space-5);
52
+ border-radius: var(--radius-xl);
53
+ box-shadow: var(--elevation-3);
54
+ }
55
+
56
+ .surface-_qTRv[data-popup="sheet"] {
57
+ gap: var(--space-4);
58
+ width: 100%;
59
+ max-width: 100%;
60
+ max-height: 85dvh;
61
+ padding: var(--space-5);
62
+ border-radius: var(--radius-xl) var(--radius-xl) 0 0;
63
+ box-shadow: var(--elevation-3);
64
+ }
65
+
66
+ .surface-_qTRv[data-popup="select"] {
67
+ min-width: max(var(--anchor-width), 10rem);
68
+ padding: var(--space-1);
69
+ gap: 0;
70
+ }
71
+
72
+ .surface-_qTRv[data-starting-style], .surface-_qTRv[data-ending-style] {
73
+ opacity: 0;
74
+ transform: scale(.96);
75
+ }
76
+
77
+ .surface-_qTRv[data-popup="sheet"][data-starting-style], .surface-_qTRv[data-popup="sheet"][data-ending-style] {
78
+ opacity: 1;
79
+ transform: translateY(100%);
80
+ }
81
+
82
+ .surface-_qTRv[data-popup="sheet"][data-side="end"] {
83
+ border-radius: 0;
84
+ width: min(28rem, 100%);
85
+ height: 100dvh;
86
+ max-height: 100dvh;
87
+ }
88
+
89
+ .surface-_qTRv[data-popup="sheet"][data-side="end"][data-starting-style], .surface-_qTRv[data-popup="sheet"][data-side="end"][data-ending-style] {
90
+ transform: translateX(100%);
91
+ }
92
+
93
+ .surface-_qTRv[data-instant] {
94
+ transition-property: none;
95
+ }
96
+
97
+ .scrim-HnQwr {
98
+ background: var(--color-scrim);
99
+ transition-property: opacity;
100
+ transition-duration: var(--motion-duration-2);
101
+ transition-timing-function: var(--motion-ease);
102
+ position: fixed;
103
+ inset: 0;
104
+ }
105
+
106
+ .scrim-HnQwr[data-starting-style], .scrim-HnQwr[data-ending-style] {
107
+ opacity: 0;
108
+ }
109
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@calcifer-design/ui",
3
- "version": "0.2.1",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@base-ui/react": "^1.8.0",
44
- "@calcifer-design/tokens": "^0.1.1",
44
+ "@calcifer-design/tokens": "^0.2.0",
45
45
  "@tanstack/react-table": "^9.2.4"
46
46
  },
47
47
  "devDependencies": {
@@ -1,5 +0,0 @@
1
- import "./LiveRegion_module.css";
2
- const LiveRegion_module = {
3
- root: "root-queRh"
4
- };
5
- export default LiveRegion_module;