@cocso-ui/react 1.10.1 → 1.12.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 (103) hide show
  1. package/dist/cjs/components/breadcrumb/breadcrumb.d.ts +24 -3
  2. package/dist/cjs/components/breadcrumb/breadcrumb.js +44 -2
  3. package/dist/cjs/components/breadcrumb/breadcrumb.module.css.js +2 -2
  4. package/dist/cjs/components/card/card.d.ts +49 -2
  5. package/dist/cjs/components/card/card.js +76 -10
  6. package/dist/cjs/components/card/card.module.css.js +2 -2
  7. package/dist/cjs/components/copy-button/copy-button.d.ts +29 -0
  8. package/dist/cjs/components/copy-button/copy-button.js +67 -0
  9. package/dist/cjs/components/date-time-picker/date-time-picker.js +99 -76
  10. package/dist/cjs/components/day-picker/day-picker.js +24 -137
  11. package/dist/cjs/components/day-picker/day-picker.module.css.js +2 -2
  12. package/dist/cjs/components/empty-state/empty-state.d.ts +30 -0
  13. package/dist/cjs/components/empty-state/empty-state.js +50 -0
  14. package/dist/cjs/components/empty-state/empty-state.module.css.js +9 -0
  15. package/dist/cjs/components/file-uploader/file-uploader.d.ts +80 -0
  16. package/dist/cjs/components/file-uploader/file-uploader.js +258 -0
  17. package/dist/cjs/components/file-uploader/file-uploader.module.css.js +9 -0
  18. package/dist/cjs/components/form-field/form-field-context.d.ts +31 -0
  19. package/dist/cjs/components/form-field/form-field-context.js +53 -0
  20. package/dist/cjs/components/form-field/form-field-parts.d.ts +52 -0
  21. package/dist/cjs/components/form-field/form-field-parts.js +109 -0
  22. package/dist/cjs/components/form-field/form-field.d.ts +44 -0
  23. package/dist/cjs/components/form-field/form-field.js +61 -0
  24. package/dist/cjs/components/form-field/form-field.module.css.js +9 -0
  25. package/dist/cjs/components/info-popover/info-popover.d.ts +43 -0
  26. package/dist/cjs/components/info-popover/info-popover.js +57 -0
  27. package/dist/cjs/components/info-popover/info-popover.module.css.js +9 -0
  28. package/dist/cjs/components/loading-overlay/loading-overlay.d.ts +33 -0
  29. package/dist/cjs/components/loading-overlay/loading-overlay.js +68 -0
  30. package/dist/cjs/components/loading-overlay/loading-overlay.module.css.js +9 -0
  31. package/dist/cjs/components/number-input/number-input.d.ts +39 -0
  32. package/dist/cjs/components/number-input/number-input.js +167 -0
  33. package/dist/cjs/components/picker/year-month-view.js +216 -0
  34. package/dist/cjs/components/picker/year-month-view.module.css.js +9 -0
  35. package/dist/cjs/components/section-header/section-header.d.ts +48 -0
  36. package/dist/cjs/components/section-header/section-header.js +210 -0
  37. package/dist/cjs/components/section-header/section-header.module.css.js +9 -0
  38. package/dist/cjs/components/segmented-control/segmented-control.d.ts +55 -0
  39. package/dist/cjs/components/segmented-control/segmented-control.js +119 -0
  40. package/dist/cjs/components/segmented-control/segmented-control.module.css.js +9 -0
  41. package/dist/cjs/components/selection-chip/selection-chip.d.ts +22 -0
  42. package/dist/cjs/components/selection-chip/selection-chip.js +32 -0
  43. package/dist/cjs/components/selection-chip/selection-chip.module.css.js +9 -0
  44. package/dist/cjs/components/skeleton/skeleton.d.ts +7 -1
  45. package/dist/cjs/components/skeleton/skeleton.js +20 -2
  46. package/dist/cjs/components/skeleton/skeleton.module.css.js +1 -1
  47. package/dist/cjs/components/summary-card/summary-card.d.ts +47 -0
  48. package/dist/cjs/components/summary-card/summary-card.js +89 -0
  49. package/dist/cjs/components/summary-card/summary-card.module.css.js +9 -0
  50. package/dist/cjs/index.d.ts +15 -2
  51. package/dist/cjs/index.js +24 -0
  52. package/dist/esm/components/breadcrumb/breadcrumb.d.mts +24 -3
  53. package/dist/esm/components/breadcrumb/breadcrumb.mjs +44 -2
  54. package/dist/esm/components/breadcrumb/breadcrumb.module.css.mjs +1 -1
  55. package/dist/esm/components/card/card.d.mts +49 -2
  56. package/dist/esm/components/card/card.mjs +76 -10
  57. package/dist/esm/components/card/card.module.css.mjs +1 -1
  58. package/dist/esm/components/copy-button/copy-button.d.mts +29 -0
  59. package/dist/esm/components/copy-button/copy-button.mjs +65 -0
  60. package/dist/esm/components/date-time-picker/date-time-picker.mjs +99 -76
  61. package/dist/esm/components/day-picker/day-picker.mjs +27 -140
  62. package/dist/esm/components/day-picker/day-picker.module.css.mjs +1 -1
  63. package/dist/esm/components/empty-state/empty-state.d.mts +30 -0
  64. package/dist/esm/components/empty-state/empty-state.mjs +48 -0
  65. package/dist/esm/components/empty-state/empty-state.module.css.mjs +3 -0
  66. package/dist/esm/components/file-uploader/file-uploader.d.mts +80 -0
  67. package/dist/esm/components/file-uploader/file-uploader.mjs +256 -0
  68. package/dist/esm/components/file-uploader/file-uploader.module.css.mjs +3 -0
  69. package/dist/esm/components/form-field/form-field-context.d.mts +31 -0
  70. package/dist/esm/components/form-field/form-field-context.mjs +49 -0
  71. package/dist/esm/components/form-field/form-field-parts.d.mts +52 -0
  72. package/dist/esm/components/form-field/form-field-parts.mjs +105 -0
  73. package/dist/esm/components/form-field/form-field.d.mts +44 -0
  74. package/dist/esm/components/form-field/form-field.mjs +59 -0
  75. package/dist/esm/components/form-field/form-field.module.css.mjs +3 -0
  76. package/dist/esm/components/info-popover/info-popover.d.mts +43 -0
  77. package/dist/esm/components/info-popover/info-popover.mjs +55 -0
  78. package/dist/esm/components/info-popover/info-popover.module.css.mjs +3 -0
  79. package/dist/esm/components/loading-overlay/loading-overlay.d.mts +33 -0
  80. package/dist/esm/components/loading-overlay/loading-overlay.mjs +66 -0
  81. package/dist/esm/components/loading-overlay/loading-overlay.module.css.mjs +3 -0
  82. package/dist/esm/components/number-input/number-input.d.mts +39 -0
  83. package/dist/esm/components/number-input/number-input.mjs +165 -0
  84. package/dist/esm/components/picker/year-month-view.mjs +212 -0
  85. package/dist/esm/components/picker/year-month-view.module.css.mjs +3 -0
  86. package/dist/esm/components/section-header/section-header.d.mts +48 -0
  87. package/dist/esm/components/section-header/section-header.mjs +208 -0
  88. package/dist/esm/components/section-header/section-header.module.css.mjs +3 -0
  89. package/dist/esm/components/segmented-control/segmented-control.d.mts +55 -0
  90. package/dist/esm/components/segmented-control/segmented-control.mjs +117 -0
  91. package/dist/esm/components/segmented-control/segmented-control.module.css.mjs +3 -0
  92. package/dist/esm/components/selection-chip/selection-chip.d.mts +22 -0
  93. package/dist/esm/components/selection-chip/selection-chip.mjs +30 -0
  94. package/dist/esm/components/selection-chip/selection-chip.module.css.mjs +3 -0
  95. package/dist/esm/components/skeleton/skeleton.d.mts +7 -1
  96. package/dist/esm/components/skeleton/skeleton.mjs +20 -2
  97. package/dist/esm/components/summary-card/summary-card.d.mts +47 -0
  98. package/dist/esm/components/summary-card/summary-card.mjs +87 -0
  99. package/dist/esm/components/summary-card/summary-card.module.css.mjs +3 -0
  100. package/dist/esm/index.css +2 -2
  101. package/dist/esm/index.d.mts +15 -2
  102. package/dist/esm/index.mjs +12 -0
  103. package/package.json +1 -1
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ var styleInject_es = require('../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js');
4
+
5
+ var css_248z = "@layer components{.file-uploader-module_uploader__H6Mi3{display:flex;flex-direction:column;gap:var(--cocso-spacing-5);width:100%}.file-uploader-module_zone__-lnp-{align-items:center;background-color:var(--cocso-color-surface-secondary);border:1px dashed var(--cocso-color-border-primary);border-radius:var(--cocso-radius-1);color:var(--cocso-color-text-secondary);cursor:pointer;display:flex;flex-direction:column;gap:var(--cocso-spacing-5);justify-content:center;padding:var(--cocso-spacing-8);position:relative;text-align:center;transition:border-color var(--cocso-duration-fast) var(--cocso-easing-default),background-color var(--cocso-duration-fast) var(--cocso-easing-default)}.file-uploader-module_zone__-lnp-:has(.file-uploader-module_input__wft8r:focus-visible){outline:2px solid var(--cocso-color-focus-ring);outline-offset:2px}.file-uploader-module_zone__-lnp-.file-uploader-module_compact__s-Ynq{flex-direction:row;gap:var(--cocso-spacing-4);padding-block:var(--cocso-spacing-5);padding-inline:var(--cocso-spacing-7);text-align:start}.file-uploader-module_zone__-lnp-[data-drag-active=true]{background-color:var(--cocso-color-interactive-primary-subtle);border-color:var(--cocso-color-interactive-primary);border-style:solid;color:var(--cocso-color-text-primary)}.file-uploader-module_zone__-lnp-[data-disabled=true]{border-color:var(--cocso-color-border-secondary);cursor:not-allowed}.file-uploader-module_input__wft8r{border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.file-uploader-module_text__hTQbR{text-wrap:balance;word-break:keep-all}.file-uploader-module_zone__-lnp-:not(.file-uploader-module_compact__s-Ynq) .file-uploader-module_prompt__bvvKg{display:block}.file-uploader-module_icon__7Pt-y{flex-shrink:0}.file-uploader-module_list__neAsl{display:flex;flex-direction:column;gap:var(--cocso-spacing-5);list-style:none;margin:0;padding:0}.file-uploader-module_item__p8Jns{display:flex}@media (prefers-reduced-motion:reduce){.file-uploader-module_zone__-lnp-{transition:none}}}";
6
+ var styles = {"uploader":"file-uploader-module_uploader__H6Mi3","zone":"file-uploader-module_zone__-lnp-","input":"file-uploader-module_input__wft8r","compact":"file-uploader-module_compact__s-Ynq","text":"file-uploader-module_text__hTQbR","prompt":"file-uploader-module_prompt__bvvKg","icon":"file-uploader-module_icon__7Pt-y","list":"file-uploader-module_list__neAsl","item":"file-uploader-module_item__p8Jns"};
7
+ styleInject_es(css_248z);
8
+
9
+ module.exports = styles;
@@ -0,0 +1,31 @@
1
+ import { ComponentProps } from 'react';
2
+ import { InputSize } from '../input/input.js';
3
+
4
+ interface FormFieldContextValue {
5
+ /** The id the row's control should carry. `FormField.Label` points at it. */
6
+ controlId: string;
7
+ /** The id `FormField.Label` carries, for controls named by `aria-labelledby`. */
8
+ labelId: string;
9
+ /** The input size the row is laid out for. */
10
+ size: InputSize;
11
+ }
12
+ /**
13
+ * The ids and size of the enclosing `FormField`.
14
+ *
15
+ * `FormField.Input` and `FormField.InputTrigger` read this themselves. Any
16
+ * other control placed in the row — a `Select`, a picker trigger, a search
17
+ * box — should take `id={controlId}` so the row's label names it. Returns
18
+ * `null` outside a `FormField`.
19
+ */
20
+ declare const useFormField: () => FormFieldContextValue | null;
21
+ interface FormFieldProps extends ComponentProps<"div"> {
22
+ /**
23
+ * The input size the row lines up with. The label's height and
24
+ * `FormField.Value`'s inset follow it, and `FormField.Input` /
25
+ * `FormField.InputTrigger` default to it.
26
+ */
27
+ size?: InputSize;
28
+ }
29
+
30
+ export { useFormField };
31
+ export type { FormFieldContextValue, FormFieldProps };
@@ -0,0 +1,53 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ var input = require('../../ecosystem/codegen/generated/input.js');
5
+ require('../../ecosystem/codegen/generated/input.css.js');
6
+ var react = require('react');
7
+ var cn = require('../../cn.js');
8
+ var formField_module = require('./form-field.module.css.js');
9
+ var jsxRuntime = require('react/jsx-runtime');
10
+
11
+ const FormFieldContext = /*#__PURE__*/react.createContext(null);
12
+
13
+ /**
14
+ * The ids and size of the enclosing `FormField`.
15
+ *
16
+ * `FormField.Input` and `FormField.InputTrigger` read this themselves. Any
17
+ * other control placed in the row — a `Select`, a picker trigger, a search
18
+ * box — should take `id={controlId}` so the row's label names it. Returns
19
+ * `null` outside a `FormField`.
20
+ */
21
+ const useFormField = () => react.useContext(FormFieldContext);
22
+ /**
23
+ * The client half of the `FormField` root: it owns the ids, so it is the part
24
+ * that needs hooks. Kept apart from `form-field.tsx` so the compound object
25
+ * itself stays importable from a React Server Component.
26
+ */
27
+ function FormFieldScope({
28
+ className,
29
+ size = "small",
30
+ children,
31
+ ...props
32
+ }) {
33
+ const controlId = react.useId();
34
+ const labelId = react.useId();
35
+ return /*#__PURE__*/jsxRuntime.jsx(FormFieldContext.Provider, {
36
+ value: {
37
+ controlId,
38
+ labelId,
39
+ size
40
+ },
41
+ children: /*#__PURE__*/jsxRuntime.jsx("div", {
42
+ className: cn.cn(input.input({
43
+ size
44
+ }), formField_module.root, className),
45
+ "data-cocso-component": "form-field",
46
+ ...props,
47
+ children: children
48
+ })
49
+ });
50
+ }
51
+
52
+ exports.FormFieldScope = FormFieldScope;
53
+ exports.useFormField = useFormField;
@@ -0,0 +1,52 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ComponentProps } from 'react';
3
+ import { InputProps } from '../input/input.js';
4
+ import { InputTriggerProps } from '../input-trigger/input-trigger.js';
5
+
6
+ interface FormFieldLabelProps extends ComponentProps<"label"> {
7
+ /**
8
+ * Appends a required marker. It is decoration only — mark the control itself
9
+ * `required` so assistive technology announces it.
10
+ */
11
+ required?: boolean;
12
+ /**
13
+ * Fixed width of the label column, so labels in one form line up. A number
14
+ * is pixels. Defaults to `--cocso-form-field-label-width`, then 128px, so a
15
+ * form can set the variable once instead of passing this on every row.
16
+ */
17
+ width?: string | number;
18
+ }
19
+ declare function FormFieldLabel({ className, style: _style, required, width, htmlFor, id, children, ...props }: FormFieldLabelProps): react_jsx_runtime.JSX.Element;
20
+ type FormFieldInputProps = InputProps;
21
+ /**
22
+ * The row's text input: an `Input` at the row's size, stretched to the space
23
+ * beside the label, carrying the id the label points at.
24
+ *
25
+ * `type="password"` turns the reveal button on by default. `Input` keeps it
26
+ * opt-in so an existing field does not change on upgrade; a `FormField` row
27
+ * has no such history, and a password typed blind is only checked by
28
+ * submitting it. Pass `passwordToggle={false}` to opt out.
29
+ *
30
+ * Every `FormField.Input` in a row defaults to the row's one id. A row holding
31
+ * two inputs (a range, say) must give the second its own `id` — and an
32
+ * `aria-label` — or the page carries a duplicate id.
33
+ */
34
+ declare function FormFieldInput({ id, size, type, passwordToggle, stretch, ...props }: FormFieldInputProps): react_jsx_runtime.JSX.Element;
35
+ interface FormFieldInputTriggerProps extends Omit<InputTriggerProps, "value"> {
36
+ /** The current value as text. `children`, when given, wins over it. */
37
+ value?: string;
38
+ }
39
+ /**
40
+ * An `InputTrigger` at the row's size — the button a picker or a popover
41
+ * opens from, looking like the inputs around it.
42
+ *
43
+ * Named by the row's label and its own text together (`aria-labelledby`
44
+ * pointing at both). A `<label for>` would replace the button's name and the
45
+ * chosen value would never be announced, so the trigger deliberately carries
46
+ * an id of its own rather than the one the label points at — with both, the
47
+ * self-reference resolves to the label a second time instead of the value.
48
+ */
49
+ declare function FormFieldInputTrigger({ id, size, value, children, stretch, "aria-labelledby": ariaLabelledBy, ...props }: FormFieldInputTriggerProps): react_jsx_runtime.JSX.Element;
50
+
51
+ export { FormFieldInput, FormFieldInputTrigger, FormFieldLabel };
52
+ export type { FormFieldInputProps, FormFieldInputTriggerProps, FormFieldLabelProps };
@@ -0,0 +1,109 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ var react = require('react');
5
+ var cn = require('../../cn.js');
6
+ var formField_module = require('./form-field.module.css.js');
7
+ var formFieldContext = require('./form-field-context.js');
8
+ var jsxRuntime = require('react/jsx-runtime');
9
+ var inputTrigger = require('../input-trigger/input-trigger.js');
10
+ var input = require('../input/input.js');
11
+
12
+ function FormFieldLabel({
13
+ className,
14
+ style: _style,
15
+ required,
16
+ width,
17
+ htmlFor,
18
+ id,
19
+ children,
20
+ ...props
21
+ }) {
22
+ const field = formFieldContext.useFormField();
23
+ const style = {
24
+ ..._style,
25
+ ...(width === undefined ? {} : {
26
+ "--cocso-form-field-label-width": typeof width === "number" ? `${width}px` : width
27
+ })
28
+ };
29
+ return /*#__PURE__*/jsxRuntime.jsxs("label", {
30
+ className: cn.cn(formField_module.label, className),
31
+ "data-cocso-component": "form-field-label",
32
+ htmlFor: htmlFor ?? field?.controlId,
33
+ id: id ?? field?.labelId,
34
+ style: style,
35
+ ...props,
36
+ children: [children, required && /*#__PURE__*/jsxRuntime.jsx("span", {
37
+ "aria-hidden": "true",
38
+ className: formField_module.required,
39
+ children: "*"
40
+ })]
41
+ });
42
+ }
43
+ /**
44
+ * The row's text input: an `Input` at the row's size, stretched to the space
45
+ * beside the label, carrying the id the label points at.
46
+ *
47
+ * `type="password"` turns the reveal button on by default. `Input` keeps it
48
+ * opt-in so an existing field does not change on upgrade; a `FormField` row
49
+ * has no such history, and a password typed blind is only checked by
50
+ * submitting it. Pass `passwordToggle={false}` to opt out.
51
+ *
52
+ * Every `FormField.Input` in a row defaults to the row's one id. A row holding
53
+ * two inputs (a range, say) must give the second its own `id` — and an
54
+ * `aria-label` — or the page carries a duplicate id.
55
+ */
56
+ function FormFieldInput({
57
+ id,
58
+ size,
59
+ type,
60
+ passwordToggle,
61
+ stretch = true,
62
+ ...props
63
+ }) {
64
+ const field = formFieldContext.useFormField();
65
+ return /*#__PURE__*/jsxRuntime.jsx(input.Input, {
66
+ id: id ?? field?.controlId,
67
+ passwordToggle: passwordToggle ?? type === "password",
68
+ size: size ?? field?.size ?? "small",
69
+ stretch: stretch,
70
+ type: type,
71
+ ...props
72
+ });
73
+ }
74
+ /**
75
+ * An `InputTrigger` at the row's size — the button a picker or a popover
76
+ * opens from, looking like the inputs around it.
77
+ *
78
+ * Named by the row's label and its own text together (`aria-labelledby`
79
+ * pointing at both). A `<label for>` would replace the button's name and the
80
+ * chosen value would never be announced, so the trigger deliberately carries
81
+ * an id of its own rather than the one the label points at — with both, the
82
+ * self-reference resolves to the label a second time instead of the value.
83
+ */
84
+ function FormFieldInputTrigger({
85
+ id,
86
+ size,
87
+ value,
88
+ children,
89
+ stretch = true,
90
+ "aria-labelledby": ariaLabelledBy,
91
+ ...props
92
+ }) {
93
+ const field = formFieldContext.useFormField();
94
+ const generatedId = react.useId();
95
+ const triggerId = id ?? generatedId;
96
+ const labelledBy = ariaLabelledBy ?? (field ? `${field.labelId} ${triggerId}` : undefined);
97
+ return /*#__PURE__*/jsxRuntime.jsx(inputTrigger.InputTrigger, {
98
+ "aria-labelledby": labelledBy,
99
+ id: triggerId,
100
+ size: size ?? field?.size ?? "small",
101
+ stretch: stretch,
102
+ ...props,
103
+ children: children ?? value
104
+ });
105
+ }
106
+
107
+ exports.FormFieldInput = FormFieldInput;
108
+ exports.FormFieldInputTrigger = FormFieldInputTrigger;
109
+ exports.FormFieldLabel = FormFieldLabel;
@@ -0,0 +1,44 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ComponentProps } from 'react';
3
+ import { FormFieldProps } from './form-field-context.js';
4
+ export { FormFieldContextValue, useFormField } from './form-field-context.js';
5
+ import { FormFieldLabel, FormFieldInput, FormFieldInputTrigger } from './form-field-parts.js';
6
+ export { FormFieldInputProps, FormFieldInputTriggerProps, FormFieldLabelProps } from './form-field-parts.js';
7
+
8
+ declare function FormFieldRoot(props: FormFieldProps): react_jsx_runtime.JSX.Element;
9
+ /**
10
+ * A value that cannot be edited, shown where the input would be — same
11
+ * height and same inset as the inputs around it, so read-only and editable
12
+ * rows start their text on one line.
13
+ */
14
+ declare function FormFieldValue({ className, ...props }: ComponentProps<"span">): react_jsx_runtime.JSX.Element;
15
+ /**
16
+ * A label beside its control, on one line — the layout of an admin form.
17
+ *
18
+ * `Field` stacks a label over its control with a description and an error
19
+ * under it; this lays them side by side with a fixed label column, so every
20
+ * row of a long form starts its control at the same place. Below 768px the
21
+ * label moves above the control.
22
+ *
23
+ * The label is tied to the control: the root makes an id, `FormField.Label`
24
+ * points at it and `FormField.Input` / `FormField.InputTrigger` carry it. Any
25
+ * other control takes it from `useFormField()`.
26
+ *
27
+ * The compound object lives in a module without `"use client"` so a Server
28
+ * Component can reach `FormField.Label`; the parts that need hooks are
29
+ * client modules of their own.
30
+ *
31
+ * @example
32
+ * <FormField>
33
+ * <FormField.Label required width={120}>Email</FormField.Label>
34
+ * <FormField.Input required type="email" />
35
+ * </FormField>
36
+ */
37
+ declare const FormField: typeof FormFieldRoot & {
38
+ Label: typeof FormFieldLabel;
39
+ Input: typeof FormFieldInput;
40
+ InputTrigger: typeof FormFieldInputTrigger;
41
+ Value: typeof FormFieldValue;
42
+ };
43
+
44
+ export { FormField, FormFieldProps };
@@ -0,0 +1,61 @@
1
+ 'use strict';
2
+
3
+ var cn = require('../../cn.js');
4
+ var formField_module = require('./form-field.module.css.js');
5
+ var formFieldContext = require('./form-field-context.js');
6
+ var formFieldParts = require('./form-field-parts.js');
7
+ var jsxRuntime = require('react/jsx-runtime');
8
+
9
+ function FormFieldRoot(props) {
10
+ return /*#__PURE__*/jsxRuntime.jsx(formFieldContext.FormFieldScope, {
11
+ ...props
12
+ });
13
+ }
14
+
15
+ /**
16
+ * A value that cannot be edited, shown where the input would be — same
17
+ * height and same inset as the inputs around it, so read-only and editable
18
+ * rows start their text on one line.
19
+ */
20
+ function FormFieldValue({
21
+ className,
22
+ ...props
23
+ }) {
24
+ return /*#__PURE__*/jsxRuntime.jsx("span", {
25
+ className: cn.cn(formField_module.value, className),
26
+ "data-cocso-component": "form-field-value",
27
+ ...props
28
+ });
29
+ }
30
+
31
+ /**
32
+ * A label beside its control, on one line — the layout of an admin form.
33
+ *
34
+ * `Field` stacks a label over its control with a description and an error
35
+ * under it; this lays them side by side with a fixed label column, so every
36
+ * row of a long form starts its control at the same place. Below 768px the
37
+ * label moves above the control.
38
+ *
39
+ * The label is tied to the control: the root makes an id, `FormField.Label`
40
+ * points at it and `FormField.Input` / `FormField.InputTrigger` carry it. Any
41
+ * other control takes it from `useFormField()`.
42
+ *
43
+ * The compound object lives in a module without `"use client"` so a Server
44
+ * Component can reach `FormField.Label`; the parts that need hooks are
45
+ * client modules of their own.
46
+ *
47
+ * @example
48
+ * <FormField>
49
+ * <FormField.Label required width={120}>Email</FormField.Label>
50
+ * <FormField.Input required type="email" />
51
+ * </FormField>
52
+ */
53
+ const FormField = Object.assign(FormFieldRoot, {
54
+ Label: formFieldParts.FormFieldLabel,
55
+ Input: formFieldParts.FormFieldInput,
56
+ InputTrigger: formFieldParts.FormFieldInputTrigger,
57
+ Value: FormFieldValue
58
+ });
59
+
60
+ exports.useFormField = formFieldContext.useFormField;
61
+ exports.FormField = FormField;
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ var styleInject_es = require('../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js');
4
+
5
+ var css_248z = "@layer components{.form-field-module_root__uDXGR{align-items:flex-start;display:flex;gap:var(--cocso-spacing-5);width:100%}.form-field-module_label__PaASx{align-items:center;color:var(--cocso-color-text-secondary);display:flex;flex-shrink:0;font-size:var(--cocso-text-sm);font-weight:var(--cocso-font-weight-medium);gap:var(--cocso-spacing-2);inline-size:var(--cocso-form-field-label-width,128px);min-block-size:var(--cocso-input-height);overflow-wrap:anywhere;word-break:keep-all}.form-field-module_required__WxLi1{color:var(--cocso-color-feedback-danger-text)}.form-field-module_root__uDXGR>:not(.form-field-module_label__PaASx){min-inline-size:0}.form-field-module_value__uaMQ5{align-items:center;color:var(--cocso-color-text-primary);display:flex;font-size:var(--cocso-input-font-size);min-block-size:var(--cocso-input-height);padding-inline:var(--cocso-input-padding-x)}@media (max-width:767px){.form-field-module_root__uDXGR{align-items:stretch;flex-direction:column;gap:var(--cocso-spacing-3)}.form-field-module_label__PaASx{inline-size:auto;min-block-size:0}}}";
6
+ var styles = {"root":"form-field-module_root__uDXGR","label":"form-field-module_label__PaASx","required":"form-field-module_required__WxLi1","value":"form-field-module_value__uaMQ5"};
7
+ styleInject_es(css_248z);
8
+
9
+ module.exports = styles;
@@ -0,0 +1,43 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ComponentProps, ReactNode } from 'react';
3
+ import { Popover } from '../popover/popover.js';
4
+
5
+ type PopoverRootProps = ComponentProps<typeof Popover>;
6
+ type PopoverContentProps = ComponentProps<typeof Popover.Content>;
7
+ interface InfoPopoverProps extends Pick<PopoverRootProps, "defaultOpen" | "open" | "onOpenChange">, Pick<PopoverContentProps, "side" | "align"> {
8
+ /** The explanation the icon opens. */
9
+ children: ReactNode;
10
+ /** Class for the panel. */
11
+ className?: string;
12
+ /** Size of the icon in pixels. Defaults to `14`. */
13
+ iconSize?: number;
14
+ /**
15
+ * Accessible name of the icon button, and of the panel it opens. The icon
16
+ * carries no text, so this is all a screen reader announces. Defaults to
17
+ * `"More information"`.
18
+ */
19
+ label?: string;
20
+ /** Class for the icon button. */
21
+ triggerClassName?: string;
22
+ /**
23
+ * Width of the panel. A number is pixels. Defaults to 300px; widen it for
24
+ * longer sentences. Never wider than the viewport less 32px.
25
+ */
26
+ width?: number | string;
27
+ }
28
+ /**
29
+ * An info icon that folds away an explanation that never changes — how a
30
+ * total is summed, why a duplicate is refused — so the card it explains stays
31
+ * short.
32
+ *
33
+ * Guidance that changes with the value or the state should stay on the page
34
+ * instead: folding it away hides exactly when it matters.
35
+ *
36
+ * Built on `Popover`, so the panel is a labelled dialog on the popover layer
37
+ * and keeps Popover's `popover-content` / `popover-positioner` hooks, as the
38
+ * pickers do. The icon button is `info-popover-trigger`.
39
+ */
40
+ declare function InfoPopover({ children, className, iconSize, label, triggerClassName, width, side, align, ...rootProps }: InfoPopoverProps): react_jsx_runtime.JSX.Element;
41
+
42
+ export { InfoPopover };
43
+ export type { InfoPopoverProps };
@@ -0,0 +1,57 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ var reactIcons = require('@cocso-ui/react-icons');
5
+ var cn = require('../../cn.js');
6
+ var infoPopover_module = require('./info-popover.module.css.js');
7
+ var jsxRuntime = require('react/jsx-runtime');
8
+ var popover = require('../popover/popover.js');
9
+
10
+ /**
11
+ * An info icon that folds away an explanation that never changes — how a
12
+ * total is summed, why a duplicate is refused — so the card it explains stays
13
+ * short.
14
+ *
15
+ * Guidance that changes with the value or the state should stay on the page
16
+ * instead: folding it away hides exactly when it matters.
17
+ *
18
+ * Built on `Popover`, so the panel is a labelled dialog on the popover layer
19
+ * and keeps Popover's `popover-content` / `popover-positioner` hooks, as the
20
+ * pickers do. The icon button is `info-popover-trigger`.
21
+ */
22
+ function InfoPopover({
23
+ children,
24
+ className,
25
+ iconSize = 14,
26
+ label = "More information",
27
+ triggerClassName,
28
+ width = 300,
29
+ side,
30
+ align,
31
+ ...rootProps
32
+ }) {
33
+ const style = {
34
+ "--cocso-info-popover-width": typeof width === "number" ? `${width}px` : width
35
+ };
36
+ return /*#__PURE__*/jsxRuntime.jsxs(popover.Popover, {
37
+ ...rootProps,
38
+ children: [/*#__PURE__*/jsxRuntime.jsx(popover.Popover.Trigger, {
39
+ "aria-label": label,
40
+ className: cn.cn(infoPopover_module.trigger, triggerClassName),
41
+ "data-cocso-component": "info-popover-trigger",
42
+ children: /*#__PURE__*/jsxRuntime.jsx(reactIcons.InfoIcon, {
43
+ "aria-hidden": "true",
44
+ size: iconSize
45
+ })
46
+ }), /*#__PURE__*/jsxRuntime.jsx(popover.Popover.Content, {
47
+ align: align,
48
+ "aria-label": label,
49
+ className: cn.cn(infoPopover_module.content, className),
50
+ side: side,
51
+ style: style,
52
+ children: children
53
+ })]
54
+ });
55
+ }
56
+
57
+ exports.InfoPopover = InfoPopover;
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ var styleInject_es = require('../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js');
4
+
5
+ var css_248z = "@layer components{.info-popover-module_trigger__-FJSm{align-items:center;background:none;border:none;border-radius:var(--cocso-radius-full);color:var(--cocso-color-text-secondary);cursor:pointer;display:inline-flex;flex-shrink:0;justify-content:center;min-block-size:24px;min-inline-size:24px;padding:0;transition:color var(--cocso-duration-fast) var(--cocso-easing-soft)}.info-popover-module_trigger__-FJSm:hover,.info-popover-module_trigger__-FJSm[data-popup-open]{color:var(--cocso-color-text-primary)}.info-popover-module_trigger__-FJSm:focus-visible{outline:2px solid var(--cocso-color-focus-ring);outline-offset:2px}@media (prefers-reduced-motion:reduce){.info-popover-module_trigger__-FJSm{transition:none}}.info-popover-module_content__A4QVA.info-popover-module_content__A4QVA{color:var(--cocso-color-text-primary);font-weight:var(--cocso-font-weight-medium);inline-size:var(--cocso-info-popover-width);max-inline-size:calc(100vw - var(--cocso-spacing-12));overflow-wrap:anywhere;white-space:normal;word-break:keep-all}}";
6
+ var styles = {"trigger":"info-popover-module_trigger__-FJSm","content":"info-popover-module_content__A4QVA"};
7
+ styleInject_es(css_248z);
8
+
9
+ module.exports = styles;
@@ -0,0 +1,33 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ComponentProps } from 'react';
3
+
4
+ interface LoadingOverlayProps extends Omit<ComponentProps<"div">, "children"> {
5
+ /** Secondary guidance under the message — how long it takes, not to close the window. */
6
+ description?: string;
7
+ /** The main line under the spinner. Also the spinner's accessible name. */
8
+ message?: string;
9
+ /** Renders the overlay only while true; renders nothing otherwise. */
10
+ open: boolean;
11
+ }
12
+ /**
13
+ * A layer that covers the whole viewport while a long task runs.
14
+ *
15
+ * For work that takes several seconds and must not be interrupted — an
16
+ * upload, say. It is `position: fixed`, so in a popup window opened with
17
+ * `window.open` it covers that whole window.
18
+ *
19
+ * It blocks the pointer, not the keyboard: content underneath stays in the
20
+ * tab order. Mark it `inert` yourself if the task must not be re-triggered
21
+ * from the keyboard.
22
+ *
23
+ * It sits on `--cocso-z-index-overlay`, the dialog backdrop layer, so it is
24
+ * drawn under an open `Dialog` panel. Override the z-index through
25
+ * `[data-cocso-component="loading-overlay"]` when it has to cover one.
26
+ *
27
+ * @example
28
+ * <LoadingOverlay open={isPending} message="정산 데이터를 업로드하고 있습니다" />
29
+ */
30
+ declare function LoadingOverlay({ ref, className, open, message, description, ...props }: LoadingOverlayProps): react_jsx_runtime.JSX.Element | null;
31
+
32
+ export { LoadingOverlay };
33
+ export type { LoadingOverlayProps };
@@ -0,0 +1,68 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ var cn = require('../../cn.js');
5
+ var loadingOverlay_module = require('./loading-overlay.module.css.js');
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+ var spinner = require('../spinner/spinner.js');
8
+ var typography = require('../typography/typography.js');
9
+ var color = require('../../token/color.js');
10
+
11
+ /**
12
+ * A layer that covers the whole viewport while a long task runs.
13
+ *
14
+ * For work that takes several seconds and must not be interrupted — an
15
+ * upload, say. It is `position: fixed`, so in a popup window opened with
16
+ * `window.open` it covers that whole window.
17
+ *
18
+ * It blocks the pointer, not the keyboard: content underneath stays in the
19
+ * tab order. Mark it `inert` yourself if the task must not be re-triggered
20
+ * from the keyboard.
21
+ *
22
+ * It sits on `--cocso-z-index-overlay`, the dialog backdrop layer, so it is
23
+ * drawn under an open `Dialog` panel. Override the z-index through
24
+ * `[data-cocso-component="loading-overlay"]` when it has to cover one.
25
+ *
26
+ * @example
27
+ * <LoadingOverlay open={isPending} message="정산 데이터를 업로드하고 있습니다" />
28
+ */
29
+ function LoadingOverlay({
30
+ ref,
31
+ className,
32
+ open,
33
+ message = "처리 중입니다",
34
+ description,
35
+ ...props
36
+ }) {
37
+ if (!open) {
38
+ return null;
39
+ }
40
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
41
+ "aria-busy": "true",
42
+ className: cn.cn(loadingOverlay_module.overlay, className),
43
+ "data-cocso-component": "loading-overlay",
44
+ ref: ref,
45
+ ...props,
46
+ children: [/*#__PURE__*/jsxRuntime.jsx(spinner.Spinner, {
47
+ label: message,
48
+ size: "large",
49
+ variant: "primary"
50
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
51
+ className: loadingOverlay_module.text,
52
+ children: [/*#__PURE__*/jsxRuntime.jsx(typography.Typography, {
53
+ color: color.colors.textPrimary,
54
+ type: "body",
55
+ weight: "medium",
56
+ children: message
57
+ }), description && /*#__PURE__*/jsxRuntime.jsx(typography.Typography, {
58
+ className: loadingOverlay_module.description,
59
+ color: color.colors.textSecondary,
60
+ size: "small",
61
+ type: "body",
62
+ children: description
63
+ })]
64
+ })]
65
+ });
66
+ }
67
+
68
+ exports.LoadingOverlay = LoadingOverlay;
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ var styleInject_es = require('../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js');
4
+
5
+ var css_248z = "@layer components{.loading-overlay-module_overlay__Xnl3P{align-items:center;backdrop-filter:blur(2px);background-color:var(--cocso-color-surface-glass);display:flex;flex-direction:column;gap:var(--cocso-spacing-7);inset:0;justify-content:center;padding-inline:var(--cocso-spacing-10);position:fixed;z-index:var(--cocso-z-index-overlay)}.loading-overlay-module_text__1581R{align-items:center;display:flex;flex-direction:column;gap:var(--cocso-spacing-3)}.loading-overlay-module_description__o0pJf{text-align:center}}";
6
+ var styles = {"overlay":"loading-overlay-module_overlay__Xnl3P","text":"loading-overlay-module_text__1581R","description":"loading-overlay-module_description__o0pJf"};
7
+ styleInject_es(css_248z);
8
+
9
+ module.exports = styles;
@@ -0,0 +1,39 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { InputProps } from '../input/input.js';
3
+
4
+ interface NumberInputProps extends Omit<InputProps, "type" | "value" | "defaultValue" | "onChange" | "passwordToggle"> {
5
+ /** Decimal places a user may type. `0`, the default, is a whole amount. */
6
+ maxFractionDigits?: number;
7
+ /** The parsed number on every edit, or `null` when the field is empty. */
8
+ onValueChange: (value: number | null) => void;
9
+ /** The current number. `null` or `undefined` shows an empty field. */
10
+ value: number | null | undefined;
11
+ }
12
+ /**
13
+ * An `Input` for amounts, grouped in thousands as the user types.
14
+ *
15
+ * It is a text field with `inputMode`, not `type="number"`: a native number
16
+ * input cannot display a separator. The caret is put back after the same digit
17
+ * when a comma is inserted or removed in front of it.
18
+ *
19
+ * Defaults to the `small` size and the full width of its container, the shape
20
+ * the field had where it came from; both can be overridden.
21
+ *
22
+ * @example
23
+ * <Controller
24
+ * control={control}
25
+ * name="amount"
26
+ * render={({ field }) => (
27
+ * <NumberInput
28
+ * aria-label="금액"
29
+ * onBlur={field.onBlur}
30
+ * onValueChange={field.onChange}
31
+ * value={field.value}
32
+ * />
33
+ * )}
34
+ * />
35
+ */
36
+ declare function NumberInput({ value, onValueChange, maxFractionDigits, onBlur, size, stretch, ...props }: NumberInputProps): react_jsx_runtime.JSX.Element;
37
+
38
+ export { NumberInput };
39
+ export type { NumberInputProps };