@nectary/components 0.33.0 → 0.35.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 (91) hide show
  1. package/accordion/index.js +35 -10
  2. package/accordion/types.d.ts +3 -2
  3. package/accordion-item/index.js +8 -4
  4. package/action-menu/index.js +7 -8
  5. package/action-menu/types.d.ts +3 -3
  6. package/action-menu-option/index.js +23 -3
  7. package/action-menu-option/types.d.ts +2 -0
  8. package/alert/index.js +1 -1
  9. package/avatar/index.js +1 -1
  10. package/button/index.js +68 -4
  11. package/button/types.d.ts +6 -0
  12. package/checkbox/index.js +64 -6
  13. package/checkbox/types.d.ts +8 -2
  14. package/date-picker/index.js +37 -12
  15. package/date-picker/types.d.ts +4 -2
  16. package/dialog/index.d.ts +1 -0
  17. package/dialog/index.js +8 -12
  18. package/dialog/types.d.ts +3 -3
  19. package/dropdown/index.js +44 -28
  20. package/dropdown/types.d.ts +6 -4
  21. package/dropdown-checkbox-option/index.js +1 -1
  22. package/dropdown-checkbox-option/types.d.ts +0 -2
  23. package/dropdown-radio-option/index.js +1 -1
  24. package/dropdown-radio-option/types.d.ts +0 -2
  25. package/dropdown-text-option/index.js +1 -1
  26. package/dropdown-text-option/types.d.ts +0 -2
  27. package/horizontal-stepper/index.d.ts +13 -0
  28. package/horizontal-stepper/index.js +104 -0
  29. package/horizontal-stepper/types.d.ts +9 -0
  30. package/horizontal-stepper/types.js +1 -0
  31. package/horizontal-stepper-item/index.d.ts +13 -0
  32. package/horizontal-stepper-item/index.js +100 -0
  33. package/horizontal-stepper-item/types.d.ts +15 -0
  34. package/horizontal-stepper-item/types.js +1 -0
  35. package/horizontal-stepper-item/utils.d.ts +2 -0
  36. package/horizontal-stepper-item/utils.js +1 -0
  37. package/icon-button/index.js +67 -3
  38. package/icon-button/types.d.ts +6 -0
  39. package/icons/create-icon-class.js +1 -1
  40. package/icons/exclamation/index.d.ts +11 -0
  41. package/icons/exclamation/index.js +4 -0
  42. package/icons-branded/create-icon-class.js +3 -7
  43. package/icons-branded/types.d.ts +3 -0
  44. package/icons-channel/create-icon-class.js +3 -7
  45. package/icons-channel/types.d.ts +3 -0
  46. package/input/index.js +50 -19
  47. package/input/types.d.ts +8 -2
  48. package/link/index.js +81 -3
  49. package/link/types.d.ts +9 -0
  50. package/package.json +1 -1
  51. package/pagination/index.js +24 -8
  52. package/pagination/types.d.ts +3 -1
  53. package/popover/index.js +10 -13
  54. package/popover/types.d.ts +4 -3
  55. package/radio/index.js +36 -8
  56. package/radio/types.d.ts +3 -1
  57. package/radio-option/index.js +1 -1
  58. package/search/types.d.ts +0 -1
  59. package/segment-collapse/index.js +28 -12
  60. package/segment-collapse/types.d.ts +3 -1
  61. package/segmented-control/index.js +28 -23
  62. package/segmented-control/types.d.ts +3 -2
  63. package/segmented-control-option/index.js +59 -13
  64. package/segmented-control-option/types.d.ts +4 -0
  65. package/segmented-icon-control/index.js +27 -16
  66. package/segmented-icon-control/types.d.ts +5 -2
  67. package/segmented-icon-control-option/index.js +54 -12
  68. package/segmented-icon-control-option/types.d.ts +4 -0
  69. package/select/index.js +68 -9
  70. package/select/types.d.ts +41 -7
  71. package/stop-events/index.d.ts +1 -0
  72. package/stop-events/index.js +40 -0
  73. package/tabs/index.js +32 -8
  74. package/tabs/types.d.ts +3 -2
  75. package/tabs-option/index.js +2 -2
  76. package/textarea/index.js +58 -4
  77. package/textarea/types.d.ts +7 -2
  78. package/tile-control/index.d.ts +11 -0
  79. package/tile-control/index.js +181 -0
  80. package/tile-control/types.d.ts +38 -0
  81. package/tile-control/types.js +1 -0
  82. package/tile-control-option/index.d.ts +11 -0
  83. package/tile-control-option/index.js +161 -0
  84. package/tile-control-option/types.d.ts +37 -0
  85. package/tile-control-option/types.js +1 -0
  86. package/time-picker/index.js +17 -3
  87. package/time-picker/types.d.ts +4 -2
  88. package/toggle/index.js +63 -5
  89. package/toggle/types.d.ts +3 -1
  90. package/utils.d.ts +1 -0
  91. package/utils.js +3 -0
package/utils.d.ts CHANGED
@@ -23,6 +23,7 @@ export declare const updateLiteralAttribute: <T extends readonly string[]>($elem
23
23
  export declare function getLiteralAttribute<T extends readonly string[]>($element: Element, literals: T, attrName: string): T[number];
24
24
  export declare function getLiteralAttribute<T extends readonly string[]>($element: Element, literals: T, attrName: string, defaultValue: null): T[number] | null;
25
25
  export declare function getLiteralAttribute<T extends readonly string[]>($element: Element, literals: T, attrName: string, defaultValue: T[number]): T[number];
26
+ export declare const clampNumber: (value: number, min: number, max: number) => number;
26
27
  declare type TRange = {
27
28
  min?: number;
28
29
  max?: number;
package/utils.js CHANGED
@@ -99,6 +99,9 @@ export function getLiteralAttribute($element, literals, attrName, defaultValue)
99
99
 
100
100
  return defaultValue;
101
101
  }
102
+ export const clampNumber = (value, min, max) => {
103
+ return Math.min(max, Math.max(min, value));
104
+ };
102
105
 
103
106
  const applyRange = (value, range) => {
104
107
  let result = value;