tyrell-react 1.0.0-TC12 → 1.0.0-TC17

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 (91) hide show
  1. package/README.md +8 -8
  2. package/dist/components/TyButton.d.ts.map +1 -1
  3. package/dist/components/TyButton.js +11 -5
  4. package/dist/components/TyButton.js.map +1 -1
  5. package/dist/components/TyCalendar.d.ts.map +1 -1
  6. package/dist/components/TyCalendar.js +7 -6
  7. package/dist/components/TyCalendar.js.map +1 -1
  8. package/dist/components/TyCheckbox.d.ts.map +1 -1
  9. package/dist/components/TyCheckbox.js +11 -18
  10. package/dist/components/TyCheckbox.js.map +1 -1
  11. package/dist/components/TyCopy.d.ts.map +1 -1
  12. package/dist/components/TyCopy.js +7 -3
  13. package/dist/components/TyCopy.js.map +1 -1
  14. package/dist/components/TyDatePicker.d.ts.map +1 -1
  15. package/dist/components/TyDatePicker.js +10 -9
  16. package/dist/components/TyDatePicker.js.map +1 -1
  17. package/dist/components/TyDropdown.d.ts.map +1 -1
  18. package/dist/components/TyDropdown.js +27 -15
  19. package/dist/components/TyDropdown.js.map +1 -1
  20. package/dist/components/TyFileUpload.d.ts.map +1 -1
  21. package/dist/components/TyFileUpload.js +7 -3
  22. package/dist/components/TyFileUpload.js.map +1 -1
  23. package/dist/components/TyIcon.d.ts.map +1 -1
  24. package/dist/components/TyIcon.js +7 -6
  25. package/dist/components/TyIcon.js.map +1 -1
  26. package/dist/components/TyInput.d.ts.map +1 -1
  27. package/dist/components/TyInput.js +10 -3
  28. package/dist/components/TyInput.js.map +1 -1
  29. package/dist/components/TyModal.d.ts.map +1 -1
  30. package/dist/components/TyModal.js +35 -10
  31. package/dist/components/TyModal.js.map +1 -1
  32. package/dist/components/TyMultiselect.d.ts.map +1 -1
  33. package/dist/components/TyMultiselect.js +16 -14
  34. package/dist/components/TyMultiselect.js.map +1 -1
  35. package/dist/components/TyOption.d.ts.map +1 -1
  36. package/dist/components/TyOption.js +7 -3
  37. package/dist/components/TyOption.js.map +1 -1
  38. package/dist/components/TyPopup.d.ts.map +1 -1
  39. package/dist/components/TyPopup.js +7 -6
  40. package/dist/components/TyPopup.js.map +1 -1
  41. package/dist/components/TyRadio.d.ts.map +1 -1
  42. package/dist/components/TyRadio.js +6 -17
  43. package/dist/components/TyRadio.js.map +1 -1
  44. package/dist/components/TyRadioGroup.d.ts.map +1 -1
  45. package/dist/components/TyRadioGroup.js +5 -2
  46. package/dist/components/TyRadioGroup.js.map +1 -1
  47. package/dist/components/TyScrollContainer.d.ts.map +1 -1
  48. package/dist/components/TyScrollContainer.js +22 -4
  49. package/dist/components/TyScrollContainer.js.map +1 -1
  50. package/dist/components/TySwitch.d.ts.map +1 -1
  51. package/dist/components/TySwitch.js +8 -18
  52. package/dist/components/TySwitch.js.map +1 -1
  53. package/dist/components/TyTab.d.ts.map +1 -1
  54. package/dist/components/TyTab.js +3 -1
  55. package/dist/components/TyTab.js.map +1 -1
  56. package/dist/components/TyTag.d.ts.map +1 -1
  57. package/dist/components/TyTag.js +11 -5
  58. package/dist/components/TyTag.js.map +1 -1
  59. package/dist/components/TyTextarea.d.ts.map +1 -1
  60. package/dist/components/TyTextarea.js +5 -2
  61. package/dist/components/TyTextarea.js.map +1 -1
  62. package/dist/components/TyTooltip.d.ts.map +1 -1
  63. package/dist/components/TyTooltip.js +4 -3
  64. package/dist/components/TyTooltip.js.map +1 -1
  65. package/dist/utils/use-boolean-prop.d.ts +36 -0
  66. package/dist/utils/use-boolean-prop.d.ts.map +1 -0
  67. package/dist/utils/use-boolean-prop.js +62 -0
  68. package/dist/utils/use-boolean-prop.js.map +1 -0
  69. package/package.json +1 -1
  70. package/src/components/TyButton.tsx +12 -5
  71. package/src/components/TyCalendar.tsx +5 -6
  72. package/src/components/TyCheckbox.tsx +11 -16
  73. package/src/components/TyCopy.tsx +9 -4
  74. package/src/components/TyDatePicker.tsx +7 -10
  75. package/src/components/TyDropdown.tsx +26 -20
  76. package/src/components/TyFileUpload.tsx +8 -3
  77. package/src/components/TyIcon.tsx +6 -7
  78. package/src/components/TyInput.tsx +10 -3
  79. package/src/components/TyModal.tsx +31 -13
  80. package/src/components/TyMultiselect.tsx +13 -17
  81. package/src/components/TyOption.tsx +8 -3
  82. package/src/components/TyPopup.tsx +5 -6
  83. package/src/components/TyRadio.tsx +6 -15
  84. package/src/components/TyRadioGroup.tsx +6 -2
  85. package/src/components/TyScrollContainer.tsx +17 -2
  86. package/src/components/TySwitch.tsx +8 -16
  87. package/src/components/TyTab.tsx +3 -1
  88. package/src/components/TyTag.tsx +12 -5
  89. package/src/components/TyTextarea.tsx +6 -2
  90. package/src/components/TyTooltip.tsx +3 -3
  91. package/src/utils/use-boolean-prop.ts +62 -0
@@ -1 +1 @@
1
- {"version":3,"file":"TyTag.d.ts","sourceRoot":"","sources":["../../src/components/TyTag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAG9D,MAAM,WAAW,kBAAmB,SAAQ,KAAK,CAAC,aAAa;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAGD,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9F,MAAM,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;IAChF,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAA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AE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IAC5C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAGD,eAAO,MAAM,KAAK,gFAuDjB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import React, { useEffect, useRef, useCallback } from 'react';
2
+ import { useBooleanProperty } from '../utils/use-boolean-prop';
2
3
  // React wrapper for ty-tag web component
3
4
  export const TyTag = React.forwardRef(({ children, onClick, onTagDismiss, notPill, clickable, dismissible, disabled, selected, ...props }, ref) => {
4
5
  const elementRef = useRef(null);
@@ -28,16 +29,21 @@ export const TyTag = React.forwardRef(({ children, onClick, onTagDismiss, notPil
28
29
  }
29
30
  }
30
31
  }, [ref]);
32
+ const isNotPill = useBooleanProperty(elementRef, 'notPill', notPill);
33
+ const isClickable = useBooleanProperty(elementRef, 'clickable', clickable);
34
+ const isDismissible = useBooleanProperty(elementRef, 'dismissible', dismissible);
35
+ const isDisabled = useBooleanProperty(elementRef, 'disabled', disabled);
36
+ const isSelected = useBooleanProperty(elementRef, 'selected', selected);
31
37
  return React.createElement('ty-tag', {
32
38
  ...props,
33
39
  // click is dispatched as composed CustomEvent by the web component — React's
34
40
  // synthetic onClick already catches it, so we just pass it through as onClick
35
41
  ...(onClick && { onClick }),
36
- ...(notPill && { 'not-pill': "" }),
37
- ...(clickable && { clickable: "" }),
38
- ...(dismissible && { dismissible: "" }),
39
- ...(disabled && { disabled: "" }),
40
- ...(selected && { selected: "" }),
42
+ ...(isNotPill && { 'not-pill': "" }),
43
+ ...(isClickable && { clickable: "" }),
44
+ ...(isDismissible && { dismissible: "" }),
45
+ ...(isDisabled && { disabled: "" }),
46
+ ...(isSelected && { selected: "" }),
41
47
  ref: elementRef,
42
48
  }, children);
43
49
  });
@@ -1 +1 @@
1
- {"version":3,"file":"TyTag.js","sourceRoot":"","sources":["../../src/components/TyTag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,M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AAG,IAAI,GAAG,IAAI,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,UAAU,CAAC;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,qBAAqB,CAAC,KAAK,IAAI,CAAC;IAE/D;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,qBAAqB,CAAC,KAAK,IAAI,CAAC;IAErE,2BAA2B;IAC3B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IAEtC,0BAA0B;IAC1B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;CACtC;AAMD,eAAO,MAAM,UAAU,qFA6HtB,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import React, { useEffect, useRef, useCallback } from 'react';
2
2
  import { needsPropertyBridge } from '../utils/react-version';
3
+ import { useBooleanProperty } from '../utils/use-boolean-prop';
3
4
  // One-time warning flag.
4
5
  let _warnedOnInputProp = false;
5
6
  // React wrapper for ty-textarea web component
@@ -100,10 +101,12 @@ export const TyTextarea = React.forwardRef(({ onChange, onChangeCommit, onFocus,
100
101
  element.value = next;
101
102
  }
102
103
  }, [props.value]);
104
+ const isDisabled = useBooleanProperty(elementRef, 'disabled', disabled);
105
+ const isRequired = useBooleanProperty(elementRef, 'required', required);
103
106
  return React.createElement('ty-textarea', {
104
107
  ...props,
105
- ...(disabled && { disabled: "" }),
106
- ...(required && { required: "" }),
108
+ ...(isDisabled && { disabled: "" }),
109
+ ...(isRequired && { required: "" }),
107
110
  ...(minHeight && { 'min-height': minHeight }), // Convert camelCase to kebab-case
108
111
  ...(maxHeight && { 'max-height': maxHeight }), // Convert camelCase to kebab-case
109
112
  ref: elementRef,
@@ -1 +1 @@
1
- {"version":3,"file":"TyTextarea.js","sourceRoot":"","sources":["../../src/components/TyTextarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AA+C7D,yBAAyB;AACzB,IAAI,kBAAkB,GAAG,KAAK,CAAC;AAE/B,8CAA8C;AAC9C,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CACxC,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACzG,MAAM,UAAU,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;IAE7C,2EAA2E;IAC3E,uEAAuE;IACvE,MAAM,WAAW,GAAI,KAAa,CAAC,OAAyC,CAAC;IAC7E,IAAI,WAAW,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC7B,IAAI,CAAC,kBAAkB,EAAE,CAAC;YACxB,kBAAkB,GAAG,IAAI,CAAC;YAC1B,OAAO,CAAC,IAAI,CACV,kDAAkD;gBAClD,uFAAuF;gBACvF,iDAAiD,CAClD,CAAC;QACJ,CAAC;QACD,QAAQ,GAAG,WAAW,CAAC;IAC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AI,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,EAAG,kCAAkC;QAClF,GAAG,CAAC,SAAS,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,EAAG,kCAAkC;QAClF,GAAG,EAAE,UAAU;KAChB,CACF,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TyTooltip.d.ts","sourceRoot":"","sources":["../../src/components/TyTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAGjD,MAAM,WAAW,cAAe,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IACvE,yDAAyD;IACzD,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAEhD,8DAA8D;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,kEAAkE;IAClE,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,+BAA+B;IAC/B,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;IAE5G,sBAAsB;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAGD,eAAO,MAAM,SAAS,oFAwDrB,CAAC"}
1
+ {"version":3,"file":"TyTooltip.d.ts","sourceRoot":"","sources":["../../src/components/TyTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAIjD,MAAM,WAAW,cAAe,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IACvE,yDAAyD;IACzD,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAEhD,8DAA8D;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,kEAAkE;IAClE,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,+BAA+B;IAC/B,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;IAE5G,sBAAsB;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAGD,eAAO,MAAM,SAAS,oFAuDrB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import React, { useEffect, useRef } from 'react';
2
+ import { useBooleanProperty } from '../utils/use-boolean-prop';
2
3
  // React wrapper for ty-tooltip web component
3
4
  export const TyTooltip = React.forwardRef(({ placement, offset, delay, disabled, flavor, children, ...props }, ref) => {
4
5
  const elementRef = useRef(null);
@@ -28,9 +29,9 @@ export const TyTooltip = React.forwardRef(({ placement, offset, delay, disabled,
28
29
  if (delay !== undefined) {
29
30
  webComponentProps.delay = delay.toString();
30
31
  }
31
- if (disabled) {
32
- webComponentProps.disabled = ''; // Boolean attributes as empty string
33
- }
32
+ const isDisabled = useBooleanProperty(elementRef, 'disabled', disabled);
33
+ if (isDisabled)
34
+ webComponentProps.disabled = '';
34
35
  if (flavor) {
35
36
  webComponentProps.flavor = flavor;
36
37
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TyTooltip.js","sourceRoot":"","sources":["../../src/components/TyTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAuBjD,6CAA6C;AAC7C,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CACvC,CAAC,EACC,SAAS,EACT,MAAM,EACN,KAAK,EACL,QAAQ,EACR,MAAM,EACN,QAAQ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U,GAAG,kBAAkB,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;IACxE,IAAI,UAAU;QAAE,iBAAiB,CAAC,QAAQ,GAAG,EAAE,CAAC;IAEhD,IAAI,MAAM,EAAE,CAAC;QACX,iBAAiB,CAAC,MAAM,GAAG,MAAM,CAAC;IACpC,CAAC;IAED,OAAO,KAAK,CAAC,aAAa,CACxB,YAAY,EACZ,iBAAiB,EACjB,QAAQ,CACT,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { RefObject } from 'react';
2
+ /**
3
+ * Coerce a value to a boolean using the same rules as the core property
4
+ * manager (packages/core/src/utils/property-manager.ts:142-152). This matters
5
+ * because consumers sometimes pass the string "false" through untyped call
6
+ * sites (JSON config, query params, server-rendered props) — and the JS
7
+ * `Boolean("false")` is surprisingly `true`.
8
+ *
9
+ * undefined | null | false | "false" | "0" → false
10
+ * "" → true (HTML boolean-attribute convention)
11
+ * any other truthy → true
12
+ */
13
+ export declare function coerceBool(value: unknown): boolean;
14
+ /**
15
+ * Imperatively keep a boolean property on the underlying custom element in
16
+ * sync with its React prop.
17
+ *
18
+ * Why this exists: React 18 sets boolean attributes as empty strings on the
19
+ * first render to a custom element but does not reliably *remove* them when
20
+ * the prop flips back to `false`. Without this bridge, `<TyModal open>` →
21
+ * `<TyModal open={false}>` leaves the `open` attribute on the element and
22
+ * the modal stays open. Same class of bug affects `disabled`, `required`,
23
+ * `clearable`, `loading`, `readonly`, `protected`, etc.
24
+ *
25
+ * React 19+ bridges this natively — the effect short-circuits via
26
+ * `needsPropertyBridge`, so this is dead code on modern React.
27
+ *
28
+ * Pass the *camelCase JS property name* on the element (e.g. `externalSearch`
29
+ * for the `external-search` attribute). The core base class handles the
30
+ * attribute-side sync once the property changes.
31
+ *
32
+ * Returns the coerced boolean so the caller can also drive its conditional
33
+ * JSX attribute emission with a value that correctly handles "false".
34
+ */
35
+ export declare function useBooleanProperty(ref: RefObject<HTMLElement | null>, propName: string, value: unknown): boolean;
36
+ //# sourceMappingURL=use-boolean-prop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-boolean-prop.d.ts","sourceRoot":"","sources":["../../src/utils/use-boolean-prop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,SAAS,EAAE,MAAM,OAAO,CAAC;AAG7C;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CASlD;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EAClC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,OAAO,GACb,OAAO,CAWT"}
@@ -0,0 +1,62 @@
1
+ import { useEffect } from 'react';
2
+ import { needsPropertyBridge } from './react-version';
3
+ /**
4
+ * Coerce a value to a boolean using the same rules as the core property
5
+ * manager (packages/core/src/utils/property-manager.ts:142-152). This matters
6
+ * because consumers sometimes pass the string "false" through untyped call
7
+ * sites (JSON config, query params, server-rendered props) — and the JS
8
+ * `Boolean("false")` is surprisingly `true`.
9
+ *
10
+ * undefined | null | false | "false" | "0" → false
11
+ * "" → true (HTML boolean-attribute convention)
12
+ * any other truthy → true
13
+ */
14
+ export function coerceBool(value) {
15
+ if (value === undefined || value === null || value === false)
16
+ return false;
17
+ if (typeof value === 'string') {
18
+ if (value === '')
19
+ return true;
20
+ const norm = value.toLowerCase().trim();
21
+ if (norm === 'false' || norm === '0')
22
+ return false;
23
+ return true;
24
+ }
25
+ return Boolean(value);
26
+ }
27
+ /**
28
+ * Imperatively keep a boolean property on the underlying custom element in
29
+ * sync with its React prop.
30
+ *
31
+ * Why this exists: React 18 sets boolean attributes as empty strings on the
32
+ * first render to a custom element but does not reliably *remove* them when
33
+ * the prop flips back to `false`. Without this bridge, `<TyModal open>` →
34
+ * `<TyModal open={false}>` leaves the `open` attribute on the element and
35
+ * the modal stays open. Same class of bug affects `disabled`, `required`,
36
+ * `clearable`, `loading`, `readonly`, `protected`, etc.
37
+ *
38
+ * React 19+ bridges this natively — the effect short-circuits via
39
+ * `needsPropertyBridge`, so this is dead code on modern React.
40
+ *
41
+ * Pass the *camelCase JS property name* on the element (e.g. `externalSearch`
42
+ * for the `external-search` attribute). The core base class handles the
43
+ * attribute-side sync once the property changes.
44
+ *
45
+ * Returns the coerced boolean so the caller can also drive its conditional
46
+ * JSX attribute emission with a value that correctly handles "false".
47
+ */
48
+ export function useBooleanProperty(ref, propName, value) {
49
+ const coerced = coerceBool(value);
50
+ useEffect(() => {
51
+ if (!needsPropertyBridge)
52
+ return;
53
+ const el = ref.current;
54
+ if (!el)
55
+ return;
56
+ if (Boolean(el[propName]) !== coerced) {
57
+ el[propName] = coerced;
58
+ }
59
+ }, [coerced, propName, ref]);
60
+ return coerced;
61
+ }
62
+ //# sourceMappingURL=use-boolean-prop.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-boolean-prop.js","sourceRoot":"","sources":["../../src/utils/use-boolean-prop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,KAAK;QAAE,OAAO,KAAK,CAAC;IAC3E,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,IAAI,KAAK,KAAK,EAAE;YAAE,OAAO,IAAI,CAAC;QAC9B,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;QACxC,IAAI,IAAI,KAAK,OAAO,IAAI,IAAI,KAAK,GAAG;YAAE,OAAO,KAAK,CAAC;QACnD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,kBAAkB,CAChC,GAAkC,EAClC,QAAgB,EAChB,KAAc;IAEd,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAClC,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,mBAAmB;YAAE,OAAO;QACjC,MAAM,EAAE,GAAG,GAAG,CAAC,OAAc,CAAC;QAC9B,IAAI,CAAC,EAAE;YAAE,OAAO;QAChB,IAAI,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,KAAK,OAAO,EAAE,CAAC;YACtC,EAAE,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC;QACzB,CAAC;IACH,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC;IAC7B,OAAO,OAAO,CAAC;AACjB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tyrell-react",
3
- "version": "1.0.0-TC12",
3
+ "version": "1.0.0-TC17",
4
4
  "description": "React wrappers for Tyrell Components",
5
5
  "type": "module",
6
6
  "main": "./dist/components/index.js",
@@ -1,4 +1,5 @@
1
1
  import React, { useEffect, useRef } from 'react';
2
+ import { useBooleanProperty } from '../utils/use-boolean-prop';
2
3
 
3
4
  type BuiltinFlavor = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'neutral';
4
5
  type ShadedFlavor = BuiltinFlavor | `${BuiltinFlavor}+` | `${BuiltinFlavor}-`;
@@ -122,16 +123,22 @@ export const TyButton = React.forwardRef<HTMLElement, TyButtonProps>(
122
123
  }
123
124
  }, [ref]);
124
125
 
126
+ const isDisabled = useBooleanProperty(elementRef, 'disabled', disabled);
127
+ const isLoading = useBooleanProperty(elementRef, 'loading', loading);
128
+ const isPill = useBooleanProperty(elementRef, 'pill', pill);
129
+ const isAction = useBooleanProperty(elementRef, 'action', action);
130
+ const isWide = useBooleanProperty(elementRef, 'wide', wide);
131
+
125
132
  const webComponentProps: Record<string, any> = {
126
133
  ...props,
127
134
  ref: elementRef,
128
135
  };
129
136
 
130
- if (disabled) webComponentProps.disabled = '';
131
- if (loading) webComponentProps.loading = '';
132
- if (pill) webComponentProps.pill = '';
133
- if (action) webComponentProps.action = '';
134
- if (wide) webComponentProps.wide = '';
137
+ if (isDisabled) webComponentProps.disabled = '';
138
+ if (isLoading) webComponentProps.loading = '';
139
+ if (isPill) webComponentProps.pill = '';
140
+ if (isAction) webComponentProps.action = '';
141
+ if (isWide) webComponentProps.wide = '';
135
142
 
136
143
  if (appearance) webComponentProps.appearance = appearance;
137
144
  if (type) webComponentProps.type = type;
@@ -1,5 +1,6 @@
1
1
  import React, { useEffect, useRef, useCallback } from 'react';
2
2
  import { needsPropertyBridge } from '../utils/react-version';
3
+ import { useBooleanProperty } from '../utils/use-boolean-prop';
3
4
 
4
5
  // Type definitions for Ty Calendar component
5
6
  export interface TyCalendarChangeEventDetail {
@@ -205,13 +206,11 @@ export const TyCalendar = React.forwardRef<HTMLElement, TyCalendarProps>(
205
206
  webComponentProps.day = day.toString();
206
207
  }
207
208
 
208
- if (showNavigation) {
209
- webComponentProps['show-navigation'] = ''; // Boolean attributes as empty string
210
- }
209
+ const isShowNavigation = useBooleanProperty(elementRef, 'showNavigation', showNavigation);
210
+ const isStateless = useBooleanProperty(elementRef, 'stateless', stateless);
211
211
 
212
- if (stateless) {
213
- webComponentProps.stateless = ''; // Boolean attributes as empty string
214
- }
212
+ if (isShowNavigation) webComponentProps['show-navigation'] = '';
213
+ if (isStateless) webComponentProps.stateless = '';
215
214
 
216
215
  if (size) {
217
216
  webComponentProps.size = size;
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useRef } from 'react';
2
- import { needsPropertyBridge } from '../utils/react-version';
2
+ import { useBooleanProperty } from '../utils/use-boolean-prop';
3
3
 
4
4
  // Type definitions for Ty Checkbox component
5
5
  export interface TyCheckboxProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange' | 'onInput'> {
@@ -110,18 +110,13 @@ export const TyCheckbox = React.forwardRef<HTMLElement, TyCheckboxProps>(
110
110
  }
111
111
  }, [ref]);
112
112
 
113
- // Imperatively sync `checked` to the underlying property. React 18 sets
114
- // boolean attributes as empty strings on first render but doesn't reliably
115
- // remove them when the prop flips back to false on a custom element.
116
- // React 19+ handles boolean prop-to-property bridging natively.
117
- useEffect(() => {
118
- if (!needsPropertyBridge) return;
119
- const element = elementRef.current as any;
120
- if (!element) return;
121
- if (Boolean(element.checked) !== Boolean(checked)) {
122
- element.checked = Boolean(checked);
123
- }
124
- }, [checked]);
113
+ // Imperative property sync for boolean props (see use-boolean-prop.ts).
114
+ // React 18 sets boolean attributes as empty strings on first render but
115
+ // doesn't reliably remove them when the prop flips back to false on a
116
+ // custom element. React 19+ handles this natively.
117
+ const isChecked = useBooleanProperty(elementRef, 'checked', checked);
118
+ const isDisabled = useBooleanProperty(elementRef, 'disabled', disabled);
119
+ const isRequired = useBooleanProperty(elementRef, 'required', required);
125
120
 
126
121
  // Convert React props to web component attributes
127
122
  const webComponentProps: Record<string, any> = {
@@ -130,9 +125,9 @@ export const TyCheckbox = React.forwardRef<HTMLElement, TyCheckboxProps>(
130
125
  };
131
126
 
132
127
  // Add boolean attributes
133
- if (checked) webComponentProps.checked = '';
134
- if (disabled) webComponentProps.disabled = '';
135
- if (required) webComponentProps.required = '';
128
+ if (isChecked) webComponentProps.checked = '';
129
+ if (isDisabled) webComponentProps.disabled = '';
130
+ if (isRequired) webComponentProps.required = '';
136
131
 
137
132
  // Add string attributes
138
133
  if (value) webComponentProps.value = value;
@@ -1,4 +1,5 @@
1
1
  import React, { useEffect, useRef } from 'react';
2
+ import { useBooleanProperty } from '../utils/use-boolean-prop';
2
3
 
3
4
  // Type definitions for Ty Copy component
4
5
  export interface TyCopyProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> {
@@ -53,6 +54,10 @@ export const TyCopy = React.forwardRef<HTMLElement, TyCopyProps>(
53
54
  }
54
55
  }, [ref]);
55
56
 
57
+ const isMultiline = useBooleanProperty(elementRef, 'multiline', multiline);
58
+ const isDisabled = useBooleanProperty(elementRef, 'disabled', disabled);
59
+ const isRequired = useBooleanProperty(elementRef, 'required', required);
60
+
56
61
  // Convert React props to web component attributes
57
62
  const webComponentProps: Record<string, any> = {
58
63
  ...props,
@@ -65,11 +70,11 @@ export const TyCopy = React.forwardRef<HTMLElement, TyCopyProps>(
65
70
  if (size) webComponentProps.size = size;
66
71
  if (flavor) webComponentProps.flavor = flavor;
67
72
  if (format) webComponentProps.format = format;
68
-
73
+
69
74
  // Add boolean attributes
70
- if (multiline) webComponentProps.multiline = '';
71
- if (disabled) webComponentProps.disabled = '';
72
- if (required) webComponentProps.required = '';
75
+ if (isMultiline) webComponentProps.multiline = '';
76
+ if (isDisabled) webComponentProps.disabled = '';
77
+ if (isRequired) webComponentProps.required = '';
73
78
 
74
79
  return React.createElement('ty-copy', webComponentProps);
75
80
  }
@@ -1,5 +1,6 @@
1
1
  import React, { useEffect, useRef, useCallback } from 'react';
2
2
  import { needsPropertyBridge } from '../utils/react-version';
3
+ import { useBooleanProperty } from '../utils/use-boolean-prop';
3
4
 
4
5
  // Type definitions for Ty DatePicker component
5
6
  export interface TyDatePickerEventDetail {
@@ -185,22 +186,18 @@ export const TyDatePicker = React.forwardRef<HTMLElement, TyDatePickerProps>(
185
186
  webComponentProps.placeholder = placeholder;
186
187
  }
187
188
 
188
- if (required) {
189
- webComponentProps.required = ''; // Boolean attributes as empty string
190
- }
189
+ const isRequired = useBooleanProperty(elementRef, 'required', required);
190
+ const isDisabled = useBooleanProperty(elementRef, 'disabled', disabled);
191
+ const isClearable = useBooleanProperty(elementRef, 'clearable', clearable);
191
192
 
192
- if (disabled) {
193
- webComponentProps.disabled = ''; // Boolean attributes as empty string
194
- }
193
+ if (isRequired) webComponentProps.required = '';
194
+ if (isDisabled) webComponentProps.disabled = '';
195
+ if (isClearable) webComponentProps.clearable = '';
195
196
 
196
197
  if (name) {
197
198
  webComponentProps.name = name;
198
199
  }
199
200
 
200
- if (clearable) {
201
- webComponentProps.clearable = ''; // Boolean attributes as empty string
202
- }
203
-
204
201
  if (format) {
205
202
  webComponentProps.format = format;
206
203
  }
@@ -1,5 +1,6 @@
1
1
  import React, { useEffect, useRef, useCallback } from 'react';
2
2
  import { needsPropertyBridge } from '../utils/react-version';
3
+ import { useBooleanProperty, coerceBool } from '../utils/use-boolean-prop';
3
4
 
4
5
  // Option data structure for data-driven approach
5
6
  export interface OptionData {
@@ -186,40 +187,45 @@ export const TyDropdown = React.forwardRef<HTMLElement, TyDropdownProps>(
186
187
  return children;
187
188
  };
188
189
 
190
+ // Imperative property sync for boolean props (see use-boolean-prop.ts).
191
+ const isDisabled = useBooleanProperty(elementRef, 'disabled', disabled);
192
+ const isLoading = useBooleanProperty(elementRef, 'loading', loading);
193
+ const isExternalSearch = coerceBool(externalSearch) || coerceBool(notSearchable) || searchable === false;
194
+ useBooleanProperty(elementRef, 'externalSearch', isExternalSearch);
195
+ // clearable: explicit boolean OR the `notClearable` alias inverts it
196
+ const isClearable = clearable !== undefined
197
+ ? coerceBool(clearable)
198
+ : (coerceBool(notClearable) ? false : undefined);
199
+ useEffect(() => {
200
+ if (!needsPropertyBridge) return;
201
+ if (isClearable === undefined) return;
202
+ const el = elementRef.current as any;
203
+ if (!el) return;
204
+ if (Boolean(el.clearable) !== isClearable) el.clearable = isClearable;
205
+ }, [isClearable]);
206
+
189
207
  // Convert React props to web component attributes
190
208
  const webComponentProps: Record<string, any> = {
191
209
  ...props,
192
210
  ref: elementRef,
193
211
  };
194
212
 
195
- // Add conditional attributes
196
- if (disabled) webComponentProps.disabled = '';
197
- if (loading) webComponentProps.loading = '';
213
+ if (isDisabled) webComponentProps.disabled = '';
214
+ if (isLoading) webComponentProps.loading = '';
215
+ if (isExternalSearch) webComponentProps['external-search'] = '';
198
216
 
199
- // External search mode: parent owns filtering, dropdown dispatches search events.
200
- // `notSearchable` and `searchable={false}` are deprecated aliases for `externalSearch`.
201
- if (externalSearch || notSearchable || searchable === false) {
202
- webComponentProps['external-search'] = '';
203
- }
204
-
205
217
  // Handle clearable functionality
206
- if (clearable !== undefined) {
207
- if (clearable) {
208
- webComponentProps.clearable = '';
209
- } else {
210
- webComponentProps['not-clearable'] = '';
211
- }
212
- }
213
-
214
- if (notClearable) {
218
+ if (isClearable === true) {
219
+ webComponentProps.clearable = '';
220
+ } else if (isClearable === false) {
215
221
  webComponentProps['not-clearable'] = '';
216
222
  }
217
-
223
+
218
224
  // Add debounce attribute
219
225
  if (debounce !== undefined) {
220
226
  webComponentProps.debounce = debounce;
221
227
  }
222
-
228
+
223
229
  // Add string attributes
224
230
  if (name) webComponentProps.name = name;
225
231
 
@@ -1,4 +1,5 @@
1
1
  import React, { useEffect, useRef } from 'react';
2
+ import { useBooleanProperty } from '../utils/use-boolean-prop';
2
3
 
3
4
  // Type definitions for Ty File Upload component
4
5
  export interface TyFileUploadProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> {
@@ -81,14 +82,18 @@ export const TyFileUpload = React.forwardRef<HTMLElement, TyFileUploadProps>(
81
82
  }
82
83
  }, [ref]);
83
84
 
85
+ const isMultiple = useBooleanProperty(elementRef, 'multiple', multiple);
86
+ const isDisabled = useBooleanProperty(elementRef, 'disabled', disabled);
87
+ const isRequired = useBooleanProperty(elementRef, 'required', required);
88
+
84
89
  const webComponentProps: Record<string, any> = {
85
90
  ...props,
86
91
  ref: elementRef,
87
92
  };
88
93
 
89
- if (multiple) webComponentProps.multiple = '';
90
- if (disabled) webComponentProps.disabled = '';
91
- if (required) webComponentProps.required = '';
94
+ if (isMultiple) webComponentProps.multiple = '';
95
+ if (isDisabled) webComponentProps.disabled = '';
96
+ if (isRequired) webComponentProps.required = '';
92
97
 
93
98
  if (name) webComponentProps.name = name;
94
99
  if (accept) webComponentProps.accept = accept;
@@ -1,4 +1,5 @@
1
1
  import React, { useEffect, useRef } from 'react';
2
+ import { useBooleanProperty } from '../utils/use-boolean-prop';
2
3
 
3
4
  // Type definitions for Ty Icon component
4
5
  export interface TyIconProps extends React.HTMLAttributes<HTMLElement> {
@@ -37,6 +38,9 @@ export const TyIcon = React.forwardRef<HTMLElement, TyIconProps>(
37
38
  }
38
39
  }, [ref]);
39
40
 
41
+ const isSpin = useBooleanProperty(elementRef, 'spin', spin);
42
+ const isPulse = useBooleanProperty(elementRef, 'pulse', pulse);
43
+
40
44
  // Convert React props to web component attributes
41
45
  const webComponentProps: Record<string, any> = {
42
46
  ...props,
@@ -49,13 +53,8 @@ export const TyIcon = React.forwardRef<HTMLElement, TyIconProps>(
49
53
  webComponentProps.size = size;
50
54
  }
51
55
 
52
- if (spin) {
53
- webComponentProps.spin = ''; // Boolean attributes as empty string
54
- }
55
-
56
- if (pulse) {
57
- webComponentProps.pulse = ''; // Boolean attributes as empty string
58
- }
56
+ if (isSpin) webComponentProps.spin = '';
57
+ if (isPulse) webComponentProps.pulse = '';
59
58
 
60
59
  if (tempo) {
61
60
  webComponentProps.tempo = tempo;
@@ -1,5 +1,6 @@
1
1
  import React, { useEffect, useRef, useCallback } from 'react';
2
2
  import { needsPropertyBridge } from '../utils/react-version';
3
+ import { useBooleanProperty } from '../utils/use-boolean-prop';
3
4
 
4
5
  // Event detail structure for ty-input events
5
6
  export interface TyInputEventDetail {
@@ -92,7 +93,7 @@ let _warnedOnInputProp = false;
92
93
 
93
94
  // React wrapper for ty-input web component
94
95
  export const TyInput = React.forwardRef<HTMLElement, TyInputProps>(
95
- ({ onChange, onChangeCommit, onFocus, onBlur, disabled, name, checked, debounce, ...props }, ref) => {
96
+ ({ onChange, onChangeCommit, onFocus, onBlur, disabled, required, name, checked, debounce, ...props }, ref) => {
96
97
  const elementRef = useRef<HTMLElement>(null);
97
98
 
98
99
  // Catch the most common mistake: passing `onInput` (React's prop) instead
@@ -206,6 +207,11 @@ export const TyInput = React.forwardRef<HTMLElement, TyInputProps>(
206
207
  }
207
208
  }, [(props as any).value]);
208
209
 
210
+ // Imperative property sync for boolean props (see use-boolean-prop.ts).
211
+ const isDisabled = useBooleanProperty(elementRef, 'disabled', disabled);
212
+ const isRequired = useBooleanProperty(elementRef, 'required', required);
213
+ const isChecked = useBooleanProperty(elementRef, 'checked', checked);
214
+
209
215
  // Convert React props to web component attributes
210
216
  const webComponentProps: Record<string, any> = {
211
217
  ...props,
@@ -213,8 +219,9 @@ export const TyInput = React.forwardRef<HTMLElement, TyInputProps>(
213
219
  };
214
220
 
215
221
  // Add conditional attributes
216
- if (disabled) webComponentProps.disabled = '';
217
- if (checked) webComponentProps.checked = '';
222
+ if (isDisabled) webComponentProps.disabled = '';
223
+ if (isRequired) webComponentProps.required = '';
224
+ if (isChecked) webComponentProps.checked = '';
218
225
 
219
226
  // Add string attributes
220
227
  if (name) webComponentProps.name = name;