@qeetrix/react 0.0.2 → 0.0.4

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 (104) hide show
  1. package/CHANGELOG.md +116 -1
  2. package/README.md +99 -0
  3. package/dist/button/button.d.ts +6 -2
  4. package/dist/button/button.js +5 -1
  5. package/dist/css/avatar.css +6 -0
  6. package/dist/css/badge.css +6 -0
  7. package/dist/css/button.css +81 -6
  8. package/dist/css/checkbox.css +9 -0
  9. package/dist/css/dialog.css +7 -0
  10. package/dist/css/drawer.css +6 -0
  11. package/dist/css/experimental/alert.css +89 -0
  12. package/dist/css/experimental/app-shell.css +258 -0
  13. package/dist/css/experimental/breadcrumb.css +67 -0
  14. package/dist/css/experimental/copy-button.css +13 -0
  15. package/dist/css/experimental/empty-state.css +63 -0
  16. package/dist/css/experimental/otp-input.css +84 -0
  17. package/dist/css/experimental/page-header.css +110 -0
  18. package/dist/css/experimental/password-input.css +21 -0
  19. package/dist/css/experimental/sidebar.css +234 -0
  20. package/dist/css/experimental/stat.css +115 -0
  21. package/dist/css/experimental/top-bar.css +299 -0
  22. package/dist/css/input.css +10 -0
  23. package/dist/css/menu.css +17 -0
  24. package/dist/css/progress.css +14 -0
  25. package/dist/css/scroll-area.css +7 -0
  26. package/dist/css/select.css +16 -0
  27. package/dist/css/separator.css +7 -0
  28. package/dist/css/skeleton.css +6 -0
  29. package/dist/css/slider.css +22 -0
  30. package/dist/css/switch.css +33 -0
  31. package/dist/css/tabs.css +11 -0
  32. package/dist/css/toast.css +7 -0
  33. package/dist/css/toggle.css +13 -0
  34. package/dist/css/tooltip.css +6 -0
  35. package/dist/dialog/dialog.d.ts +4 -1
  36. package/dist/dialog/dialog.js +4 -3
  37. package/dist/drawer/drawer.d.ts +4 -1
  38. package/dist/drawer/drawer.js +5 -4
  39. package/dist/experimental/alert/alert.d.ts +29 -0
  40. package/dist/experimental/alert/alert.js +72 -0
  41. package/dist/experimental/alert/index.d.ts +2 -0
  42. package/dist/experimental/app-shell/app-shell.d.ts +60 -0
  43. package/dist/experimental/app-shell/app-shell.js +224 -0
  44. package/dist/experimental/app-shell/index.d.ts +2 -0
  45. package/dist/experimental/breadcrumb/breadcrumb.d.ts +27 -0
  46. package/dist/experimental/breadcrumb/breadcrumb.js +48 -0
  47. package/dist/experimental/breadcrumb/index.d.ts +2 -0
  48. package/dist/experimental/copy-button/copy-button.d.ts +27 -0
  49. package/dist/experimental/copy-button/copy-button.js +61 -0
  50. package/dist/experimental/copy-button/index.d.ts +2 -0
  51. package/dist/experimental/empty-state/data-state.d.ts +23 -0
  52. package/dist/experimental/empty-state/data-state.js +40 -0
  53. package/dist/experimental/empty-state/empty-state.d.ts +26 -0
  54. package/dist/experimental/empty-state/empty-state.js +46 -0
  55. package/dist/experimental/empty-state/index.d.ts +3 -0
  56. package/dist/experimental/index.d.ts +24 -0
  57. package/dist/experimental/index.js +13 -0
  58. package/dist/experimental/otp-input/index.d.ts +2 -0
  59. package/dist/experimental/otp-input/otp-input.d.ts +27 -0
  60. package/dist/experimental/otp-input/otp-input.js +39 -0
  61. package/dist/experimental/page-header/index.d.ts +2 -0
  62. package/dist/experimental/page-header/page-header.d.ts +32 -0
  63. package/dist/experimental/page-header/page-header.js +73 -0
  64. package/dist/experimental/password-input/index.d.ts +2 -0
  65. package/dist/experimental/password-input/password-input.d.ts +26 -0
  66. package/dist/experimental/password-input/password-input.js +103 -0
  67. package/dist/experimental/sidebar/index.d.ts +2 -0
  68. package/dist/experimental/sidebar/sidebar.d.ts +64 -0
  69. package/dist/experimental/sidebar/sidebar.js +200 -0
  70. package/dist/experimental/stat/index.d.ts +2 -0
  71. package/dist/experimental/stat/stat.d.ts +31 -0
  72. package/dist/experimental/stat/stat.js +90 -0
  73. package/dist/experimental/top-bar/index.d.ts +2 -0
  74. package/dist/experimental/top-bar/top-bar.d.ts +60 -0
  75. package/dist/experimental/top-bar/top-bar.js +162 -0
  76. package/dist/field/field.d.ts +4 -1
  77. package/dist/field/field.js +6 -5
  78. package/dist/format/format.d.ts +12 -0
  79. package/dist/format/format.js +50 -0
  80. package/dist/format/index.d.ts +2 -0
  81. package/dist/format/index.js +1 -0
  82. package/dist/index.d.ts +6 -2
  83. package/dist/index.js +3 -1
  84. package/dist/internal/media.js +15 -0
  85. package/dist/internal/messages.d.ts +75 -0
  86. package/dist/internal/messages.js +44 -5
  87. package/dist/link/link.d.ts +7 -1
  88. package/dist/link/link.js +3 -2
  89. package/dist/locales/hi.d.ts +8 -0
  90. package/dist/locales/hi.js +60 -0
  91. package/dist/progress/progress.d.ts +2 -2
  92. package/dist/progress/progress.js +7 -2
  93. package/dist/provider/index.d.ts +3 -0
  94. package/dist/provider/index.js +1 -0
  95. package/dist/provider/provider.d.ts +46 -0
  96. package/dist/provider/provider.js +90 -0
  97. package/dist/slider/slider.d.ts +5 -2
  98. package/dist/slider/slider.js +10 -3
  99. package/dist/styles.css +1704 -104
  100. package/dist/text-field/text-field.d.ts +2 -2
  101. package/dist/text-field/text-field.js +4 -2
  102. package/dist/toast/toast.d.ts +4 -1
  103. package/dist/toast/toast.js +7 -6
  104. package/package.json +18 -2
@@ -1,7 +1,7 @@
1
1
  import { FieldProps } from "../field/field.js";
2
2
  import { InputProps } from "../input/input.js";
3
3
  import { CSSProperties, ReactElement } from "react";
4
- type FieldOnly = Pick<FieldProps, "label" | "description" | "error" | "optional" | "hideLabel" | "invalid" | "validate" | "validationMode" | "validationDebounceTime" | "dirty" | "touched" | "actionsRef">;
4
+ type FieldOnly = Pick<FieldProps, "label" | "description" | "error" | "optional" | "hideLabel" | "invalid" | "validate" | "validationMode" | "validationDebounceTime" | "dirty" | "touched" | "actionsRef" | "messages">;
5
5
  export interface TextFieldProps extends Omit<InputProps, "className" | "style">, FieldOnly {
6
6
  /** Placement of the whole row only (margin, width, grid placement). */
7
7
  className?: string;
@@ -11,5 +11,5 @@ export interface TextFieldProps extends Omit<InputProps, "className" | "style">,
11
11
  * Field + Input in one: the default way to build a text row (D-12). `name`, `disabled` and
12
12
  * validation go to the Field; `ref`, `required`, `readOnly` and every other prop go to the input.
13
13
  */
14
- export declare function TextField({ label, description, error, optional, hideLabel, invalid, validate, validationMode, validationDebounceTime, dirty, touched, actionsRef, name, disabled, className, style, ...inputProps }: TextFieldProps): ReactElement;
14
+ export declare function TextField({ label, description, error, optional, hideLabel, invalid, validate, validationMode, validationDebounceTime, dirty, touched, actionsRef, messages, name, disabled, className, style, ...inputProps }: TextFieldProps): ReactElement;
15
15
  export {};
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { cx } from "../internal/cx.js";
3
+ import { useMessages } from "../provider/provider.js";
3
4
  import { FieldMessages, labelText } from "../field/field.js";
4
5
  import { Input } from "../input/input.js";
5
6
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -9,7 +10,8 @@ import { Field } from "@base-ui/react/field";
9
10
  * Field + Input in one: the default way to build a text row (D-12). `name`, `disabled` and
10
11
  * validation go to the Field; `ref`, `required`, `readOnly` and every other prop go to the input.
11
12
  */
12
- function TextField({ label, description, error, optional, hideLabel, invalid, validate, validationMode, validationDebounceTime, dirty, touched, actionsRef, name, disabled, className, style, ...inputProps }) {
13
+ function TextField({ label, description, error, optional, hideLabel, invalid, validate, validationMode, validationDebounceTime, dirty, touched, actionsRef, messages, name, disabled, className, style, ...inputProps }) {
14
+ const strings = useMessages("field", messages);
13
15
  return /* @__PURE__ */ jsxs(Field.Root, {
14
16
  name,
15
17
  disabled,
@@ -28,7 +30,7 @@ function TextField({ label, description, error, optional, hideLabel, invalid, va
28
30
  className: "qx-field-label",
29
31
  "data-slot": "field-label",
30
32
  "data-hidden": hideLabel ? "" : void 0,
31
- children: labelText(label, optional)
33
+ children: labelText(label, optional, strings.optional)
32
34
  }),
33
35
  /* @__PURE__ */ jsx(Input, { ...inputProps }),
34
36
  /* @__PURE__ */ jsx(FieldMessages, {
@@ -1,3 +1,4 @@
1
+ import { QeetrixMessages } from "../internal/messages.js";
1
2
  import { ReactElement, ReactNode } from "react";
2
3
  export type ToastTone = "info" | "success" | "warning" | "danger";
3
4
  export interface ToastOptions {
@@ -41,6 +42,8 @@ export interface ToastProviderProps {
41
42
  limit?: number;
42
43
  /** Default milliseconds before a toast closes. Default 5000. */
43
44
  timeout?: number;
45
+ /** The region's name and the close label, over QeetrixProvider's and the English defaults. */
46
+ messages?: Partial<QeetrixMessages["toast"]>;
44
47
  }
45
48
  /**
46
49
  * Shows toasts from anywhere inside ToastProvider:
@@ -51,4 +54,4 @@ export declare function useToast(): ToastApi;
51
54
  * Wrap the app once. It renders the toast region: a landmark named "Notifications" at the bottom
52
55
  * end, reachable with F6. Toasts pause while hovered or focused and swipe away on touch.
53
56
  */
54
- export declare function ToastProvider({ children, limit, timeout }: ToastProviderProps): ReactElement;
57
+ export declare function ToastProvider({ children, limit, timeout, messages }: ToastProviderProps): ReactElement;
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { messages } from "../internal/messages.js";
3
2
  import { Button, IconButton } from "../button/button.js";
3
+ import { useMessages } from "../provider/provider.js";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { CircleAlertIcon } from "@qeetrix/icons/icons/circle-alert";
6
6
  import { XIcon } from "@qeetrix/icons/icons/x";
@@ -60,7 +60,7 @@ function useToast() {
60
60
  })
61
61
  };
62
62
  }
63
- function ToastList() {
63
+ function ToastList({ closeLabel }) {
64
64
  const { toasts } = Toast.useToastManager();
65
65
  return toasts.map((toast) => {
66
66
  const tone = toast.type ?? "info";
@@ -96,7 +96,7 @@ function ToastList() {
96
96
  }),
97
97
  /* @__PURE__ */ jsx(Toast.Close, { render: /* @__PURE__ */ jsx(IconButton, {
98
98
  icon: XIcon,
99
- "aria-label": messages.toast.close,
99
+ "aria-label": closeLabel,
100
100
  size: "sm",
101
101
  tooltip: false
102
102
  }) })
@@ -108,15 +108,16 @@ function ToastList() {
108
108
  * Wrap the app once. It renders the toast region: a landmark named "Notifications" at the bottom
109
109
  * end, reachable with F6. Toasts pause while hovered or focused and swipe away on touch.
110
110
  */
111
- function ToastProvider({ children, limit = 3, timeout = 5e3 }) {
111
+ function ToastProvider({ children, limit = 3, timeout = 5e3, messages }) {
112
+ const strings = useMessages("toast", messages);
112
113
  return /* @__PURE__ */ jsxs(Toast.Provider, {
113
114
  limit,
114
115
  timeout,
115
116
  children: [children, /* @__PURE__ */ jsx(Toast.Portal, { children: /* @__PURE__ */ jsx(Toast.Viewport, {
116
117
  className: "qx-toast-viewport",
117
118
  "data-slot": "toast-viewport",
118
- "aria-label": messages.toast.region,
119
- children: /* @__PURE__ */ jsx(ToastList, {})
119
+ "aria-label": strings.region,
120
+ children: /* @__PURE__ */ jsx(ToastList, { closeLabel: strings.close })
120
121
  }) })]
121
122
  });
122
123
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qeetrix/react",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "Qeetrix React components: accessible, token-driven primitives on Base UI for every Qeet product.",
5
5
  "keywords": [
6
6
  "qeetrix",
@@ -71,6 +71,10 @@
71
71
  "types": "./dist/drawer/index.d.ts",
72
72
  "default": "./dist/drawer/index.js"
73
73
  },
74
+ "./experimental": {
75
+ "types": "./dist/experimental/index.d.ts",
76
+ "default": "./dist/experimental/index.js"
77
+ },
74
78
  "./field": {
75
79
  "types": "./dist/field/index.d.ts",
76
80
  "default": "./dist/field/index.js"
@@ -79,6 +83,10 @@
79
83
  "types": "./dist/fieldset/index.d.ts",
80
84
  "default": "./dist/fieldset/index.js"
81
85
  },
86
+ "./format": {
87
+ "types": "./dist/format/index.d.ts",
88
+ "default": "./dist/format/index.js"
89
+ },
82
90
  "./grid": {
83
91
  "types": "./dist/grid/index.d.ts",
84
92
  "default": "./dist/grid/index.js"
@@ -111,6 +119,10 @@
111
119
  "types": "./dist/progress/index.d.ts",
112
120
  "default": "./dist/progress/index.js"
113
121
  },
122
+ "./provider": {
123
+ "types": "./dist/provider/index.d.ts",
124
+ "default": "./dist/provider/index.js"
125
+ },
114
126
  "./radio": {
115
127
  "types": "./dist/radio/index.d.ts",
116
128
  "default": "./dist/radio/index.js"
@@ -183,6 +195,10 @@
183
195
  "types": "./dist/visually-hidden/index.d.ts",
184
196
  "default": "./dist/visually-hidden/index.js"
185
197
  },
198
+ "./locales/hi": {
199
+ "types": "./dist/locales/hi.d.ts",
200
+ "default": "./dist/locales/hi.js"
201
+ },
186
202
  "./styles.css": "./dist/styles.css",
187
203
  "./css/*": "./dist/css/*",
188
204
  "./package.json": "./package.json"
@@ -206,7 +222,7 @@
206
222
  },
207
223
  "peerDependencies": {
208
224
  "@base-ui/react": "^1.9.0",
209
- "@qeetrix/tokens": "^0.0.5",
225
+ "@qeetrix/tokens": "^0.0.7",
210
226
  "react": "^19.2.0",
211
227
  "react-dom": "^19.2.0"
212
228
  },