asma-ui-core 3.125.0 → 3.126.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 (23) hide show
  1. package/dist/asma-ui-core.css +1 -1
  2. package/dist/components/data-display/interactive-chip/StyledInteractiveChip.js +6 -5
  3. package/dist/components/data-display/read-only-text/StyledReadOnlyText.js +56 -0
  4. package/dist/components/inputs/checkbox/base-ui/StyledCheckbox.module.js +12 -12
  5. package/dist/components/inputs/field-styles.js +1 -1
  6. package/dist/components/inputs/input-field/StyledInputField.js +226 -205
  7. package/dist/components/miscellaneous/StyledFormControlLabel.js +14 -14
  8. package/dist/datetime/components/date-picker/components/BaseDatePickerInput.js +81 -73
  9. package/dist/datetime/components/date-picker/components/DatePickerInputRangeCompact.js +28 -26
  10. package/dist/datetime/components/date-picker/components/DatePickerInputSingle.js +23 -21
  11. package/dist/datetime/components/time-picker/StyledTimePicker.js +25 -25
  12. package/dist/datetime/components/time-picker/TimePickerInput.js +41 -40
  13. package/dist/index.js +223 -221
  14. package/dist/src/components/data-display/read-only-text/StyledReadOnlyText.d.ts +38 -0
  15. package/dist/src/components/data-display/read-only-text/index.d.ts +1 -0
  16. package/dist/src/components/inputs/field-styles.d.ts +3 -1
  17. package/dist/src/components/inputs/input-field/StyledInputField.d.ts +14 -1
  18. package/dist/src/datetime/components/date-picker/components/BaseDatePickerInput.d.ts +2 -0
  19. package/dist/src/datetime/components/date-picker/types.d.ts +7 -0
  20. package/dist/src/datetime/components/time-picker/types.d.ts +2 -0
  21. package/dist/src/index.d.ts +1 -0
  22. package/dist/table/shared-components/StyledCheckbox.module.js +11 -11
  23. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ export * from './StyledReadOnlyText';
@@ -29,9 +29,11 @@ export type FieldLabelPlacement = 'above' | 'floating';
29
29
  /**
30
30
  * The label above a field, as `StyledPhoneField` draws it. It wraps and is never truncated (TRUNC-4).
31
31
  * Put it on a wrapper around the `<label>`: apps in the shell ship `label { padding: 0 !important }`.
32
+ * `flush` drops the 4px gap for a read-only value, whose text sits right under its title (Figma Title + data).
32
33
  */
33
- export declare const fieldLabelAboveClass: ({ disabled }?: {
34
+ export declare const fieldLabelAboveClass: ({ disabled, flush }?: {
34
35
  disabled?: boolean;
36
+ flush?: boolean;
35
37
  }) => string;
36
38
  /**
37
39
  * Shared outlined-field styling so `StyledInputField`, `StyledInputLabel` (+ `StyledFormControl`)
@@ -55,6 +55,19 @@ export interface StyledInputFieldProps {
55
55
  disabled?: boolean;
56
56
  /** @figmaProp State = true→"Read only" */
57
57
  readOnly?: boolean;
58
+ /**
59
+ * @figmaProp State = set→"Locked". A field the user normally edits here whose editing is paused
60
+ * for now (disabled-states DIS-9): read-only, with a lock icon at the end, the default cursor and a
61
+ * focus ring. The reason opens on hover, focus and tap and is the field's description.
62
+ */
63
+ lockedReason?: ReactNode;
64
+ /**
65
+ * @figmaProp State = set→"Read only". A single value inside a form the user is editing that they
66
+ * cannot change here but can change elsewhere (disabled-states DIS-6): text-like, without border or
67
+ * fill, focusable and selectable with a focus ring and the default cursor. The reason says where it
68
+ * can be changed; it opens on hover, focus and tap and is the field's description. `lockedReason` wins.
69
+ */
70
+ readOnlyReason?: ReactNode;
58
71
  required?: boolean;
59
72
  allowClear?: boolean;
60
73
  onClear?: () => void;
@@ -109,5 +122,5 @@ export interface StyledInputFieldProps {
109
122
  * the visual gate. Multiline auto-grows between `minRows` and `maxRows` (a fixed `rows` pins the height)
110
123
  * and scrolls once the content exceeds the cap; `readOnly` ignores the cap and shows the whole value.
111
124
  */
112
- export declare const StyledInputField: ({ dataTest, label, labelPlacement, value, defaultValue, onChange, onBlur, onFocus, error, helperText, reserveHelperText, expandHelperText, maxLength, counter, locale, disabled, readOnly, required, allowClear, onClear, type, placeholder, name, id, autoComplete, autoFocus, multiline, rows, minRows, maxRows, size, width, fullWidth: _fullWidth, className, style, sx, inputRef, slotProps, InputProps, onKeyDown, onClick, variant: _variant, }: StyledInputFieldProps) => JSX.Element;
125
+ export declare const StyledInputField: ({ dataTest, label, labelPlacement, value, defaultValue, onChange, onBlur, onFocus, error, helperText, reserveHelperText, expandHelperText, maxLength, counter, locale, disabled, readOnly: readOnlyProp, lockedReason, readOnlyReason, required, allowClear, onClear, type, placeholder, name, id, autoComplete, autoFocus, multiline, rows, minRows, maxRows, size, width, fullWidth: _fullWidth, className, style, sx, inputRef, slotProps, InputProps, onKeyDown, onClick, variant: _variant, }: StyledInputFieldProps) => JSX.Element;
113
126
  export {};
@@ -6,6 +6,8 @@ export interface IBaseDatePickerInput {
6
6
  inputClassName?: string;
7
7
  disabled: boolean;
8
8
  readOnly?: boolean;
9
+ lockedReason?: React.ReactNode;
10
+ readOnlyReason?: React.ReactNode;
9
11
  onClick: (e: React.MouseEvent<HTMLDivElement | HTMLButtonElement>) => void;
10
12
  selected: Date | undefined;
11
13
  dateFormat?: string;
@@ -5,6 +5,13 @@ export type CalendarProps = React.ComponentProps<typeof DayPicker>;
5
5
  type CommonDatePickerProps = {
6
6
  dateFormat?: string;
7
7
  readOnly?: boolean;
8
+ /** A locked field (disabled-states DIS-9): read-only with a lock icon; the reason opens on hover, focus and tap. */
9
+ lockedReason?: React.ReactNode;
10
+ /**
11
+ * A read-only value the user can change elsewhere (disabled-states DIS-6): the date as text-like,
12
+ * focusable text with no calendar button; the reason says where it can be changed.
13
+ */
14
+ readOnlyReason?: React.ReactNode;
8
15
  className?: string;
9
16
  inputClassName?: string;
10
17
  disabledDays?: Matcher | Matcher[];
@@ -9,6 +9,8 @@ export interface StyledTimePickerProps {
9
9
  placeholder?: string;
10
10
  disabled?: boolean;
11
11
  readOnly?: boolean;
12
+ /** A locked field (disabled-states DIS-9): read-only with a lock icon; the reason opens on hover, focus and tap. */
13
+ lockedReason?: ReactNode;
12
14
  inputClassName?: string;
13
15
  dataTest: string;
14
16
  /** Field width pattern step; defaults to XS. A number (a fixed `px` width) is deprecated: use a step. */
@@ -7,6 +7,7 @@ export * from './components/data-display/virtualized-list';
7
7
  export * from './components/icons';
8
8
  export * from './components/data-display/typography';
9
9
  export * from './components/data-display/form-label';
10
+ export * from './components/data-display/read-only-text';
10
11
  export * from './components/data-display/ai-disclosure';
11
12
  export * from './components/feedback/dialog';
12
13
  export * from './components/feedback/empty-page/StyledEmptyPage';
@@ -1,16 +1,16 @@
1
- var e = "_CheckboxWrapper_b7zlc_1", _ = "_Checkbox_b7zlc_1", r = "_Indeterminate_b7zlc_30", a = "_ReadOnly_b7zlc_57", l = "_Indicator_b7zlc_66", c = "_HideWrapper_b7zlc_70", b = "_CheckboxHover_b7zlc_77", p = "_CheckboxRippleContainer_b7zlc_77", i = "_CheckboxRipple_b7zlc_77", o = "_ripple_b7zlc_1", z = {
1
+ var e = "_CheckboxWrapper_nxzpn_1", _ = "_Checkbox_nxzpn_1", n = "_Indeterminate_nxzpn_30", p = "_ReadOnly_nxzpn_57", r = "_Indicator_nxzpn_69", a = "_HideWrapper_nxzpn_73", x = "_CheckboxHover_nxzpn_80", i = "_CheckboxRippleContainer_nxzpn_80", o = "_CheckboxRipple_nxzpn_80", l = "_ripple_nxzpn_1", z = {
2
2
  CheckboxWrapper: e,
3
- "size-small": "_size-small_b7zlc_13",
4
- "size-medium": "_size-medium_b7zlc_17",
3
+ "size-small": "_size-small_nxzpn_13",
4
+ "size-medium": "_size-medium_nxzpn_17",
5
5
  Checkbox: _,
6
- Indeterminate: r,
7
- ReadOnly: a,
8
- Indicator: l,
9
- HideWrapper: c,
10
- CheckboxHover: b,
11
- CheckboxRippleContainer: p,
12
- CheckboxRipple: i,
13
- ripple: o
6
+ Indeterminate: n,
7
+ ReadOnly: p,
8
+ Indicator: r,
9
+ HideWrapper: a,
10
+ CheckboxHover: x,
11
+ CheckboxRippleContainer: i,
12
+ CheckboxRipple: o,
13
+ ripple: l
14
14
  };
15
15
  export {
16
16
  z as default
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.125.0",
6
+ "version": "3.126.0",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",