@nova-design-system/nova-react 3.23.0 → 3.25.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/README.md +1 -0
  2. package/dist/cjs/dom.utils-CuXVGECR-8VY5SfMZ.js +177 -0
  3. package/dist/cjs/events.utils-B6GgGra--01N__3wY.js +23 -0
  4. package/dist/cjs/generated/components.server.js +124 -58
  5. package/dist/cjs/{grow.animation-CvHGHBL4-DDIEYBK-.js → grow.animation-D7ep_aVl-BuXEDSK-.js} +0 -21
  6. package/dist/cjs/{i18n.utils-DOZbXX2L-BizoXo6c.js → i18n.utils-IlwlcG9l-ku0bScip.js} +14 -18
  7. package/dist/cjs/index-DUlunl9a.js +9696 -0
  8. package/dist/cjs/{nv-dialog.entry-O47Eol_7.js → index.esm-D3eWMME9-CG1TVKfu.js} +1 -296
  9. package/dist/cjs/index.js +5 -1
  10. package/dist/cjs/{nv-accordion-item.entry-B_l0-ux0.js → nv-accordion-item.entry-CqnjIt4R.js} +8 -7
  11. package/dist/cjs/{nv-accordion.entry-BX8_YuZF.js → nv-accordion.entry-Dx7FmGg_.js} +11 -14
  12. package/dist/cjs/{nv-alert.entry-DCWYR0OK.js → nv-alert.entry-BL3Pdcxd.js} +7 -6
  13. package/dist/cjs/nv-avatar.entry-2dFR4I9_.js +68 -0
  14. package/dist/cjs/nv-badge_2.entry-5FShR2Ax.js +218 -0
  15. package/dist/cjs/nv-breadcrumb.entry-Cfi32bBT.js +49 -0
  16. package/dist/cjs/nv-breadcrumbs.entry-BSgn3KUO.js +21 -0
  17. package/dist/cjs/nv-button.entry-BdQQ_LE7.js +166 -0
  18. package/dist/cjs/{nv-buttongroup.entry-BZaTKN_n.js → nv-buttongroup.entry-BM8CwXFK.js} +13 -7
  19. package/dist/cjs/{nv-calendar.entry-D9ESuu7C.js → nv-calendar.entry-CeKsMGOa.js} +39 -32
  20. package/dist/cjs/nv-col.entry-D-h2PGcz.js +38 -0
  21. package/dist/cjs/{nv-datagrid.entry-DcB5q2oC.js → nv-datagrid.entry-nOBIfqOS.js} +113 -255
  22. package/dist/cjs/{nv-datagridcolumn.entry-BhKOzXA6.js → nv-datagridcolumn.entry-BAzTU_KM.js} +2 -2
  23. package/dist/cjs/nv-dialog.entry-Bi2ZVSe2.js +299 -0
  24. package/dist/cjs/{nv-dialogfooter_2.entry-Dn16bI8a.js → nv-dialogfooter_2.entry-D6lzC-3S.js} +11 -29
  25. package/dist/cjs/nv-drawer.entry-Dp4AfBiF.js +445 -0
  26. package/dist/cjs/nv-drawerfooter_2.entry-DpWSsq6d.js +128 -0
  27. package/dist/cjs/nv-fieldcheckbox.entry-COA3LXnX.js +179 -0
  28. package/dist/cjs/{nv-fielddate.entry-B4P0U8QG.js → nv-fielddate.entry-B8r5RFXd.js} +20 -21
  29. package/dist/cjs/{nv-fielddaterange.entry-BORwYJ-k.js → nv-fielddaterange.entry-C6_Kq93P.js} +20 -19
  30. package/dist/cjs/{nv-fielddropdown.entry-DzBAIynY.js → nv-fielddropdown.entry-B2Dr5zHd.js} +51 -58
  31. package/dist/cjs/nv-fielddropdownitem.entry-DapivVnR.js +69 -0
  32. package/dist/cjs/{nv-fieldmultiselect.entry-DiqRreWh.js → nv-fieldmultiselect.entry-DSpQeiPx.js} +45 -49
  33. package/dist/cjs/nv-fieldnumber.entry-BwxR9sRr.js +189 -0
  34. package/dist/cjs/nv-fieldpassword.entry-BOSU-Skh.js +167 -0
  35. package/dist/cjs/nv-fieldradio.entry-ZFafNY5_.js +105 -0
  36. package/dist/cjs/nv-fieldselect.entry-CfWjQAd9.js +405 -0
  37. package/dist/cjs/{nv-fieldslider.entry-CozmnUfN.js → nv-fieldslider.entry-dDPcWUxs.js} +34 -16
  38. package/dist/cjs/nv-fieldtext.entry-Yaa-mkjJ.js +163 -0
  39. package/dist/cjs/{nv-fieldtextarea.entry-7UrKWDHg.js → nv-fieldtextarea.entry-Dp_l2pKZ.js} +18 -13
  40. package/dist/cjs/{nv-fieldtime.entry-DakOlLiO.js → nv-fieldtime.entry-CWxi4Uel.js} +38 -40
  41. package/dist/cjs/{nv-icon.entry-Db00kB2u.js → nv-icon.entry-Dci11W9S.js} +5 -5
  42. package/dist/cjs/nv-iconbutton_2.entry-A6FKFJT_.js +171 -0
  43. package/dist/cjs/{nv-menu.entry-CK2HdmBt.js → nv-menu.entry-BHaYP-9M.js} +11 -16
  44. package/dist/cjs/nv-menuitem.entry-Cm1vvN25.js +59 -0
  45. package/dist/cjs/nv-notification-bullet.entry-DRlS3Ybc.js +76 -0
  46. package/dist/cjs/nv-notification.entry-BeDmR-XC.js +176 -0
  47. package/dist/cjs/nv-notificationcontainer.entry-C3p_87Dg.js +41 -0
  48. package/dist/cjs/nv-paginationtable.entry-BzEqQOBa.js +231 -0
  49. package/dist/cjs/{nv-popover.entry-mLdLSp6n.js → nv-popover.entry-D2oFn9vL.js} +118 -46
  50. package/dist/cjs/nv-row.entry-hV1kxmrr.js +22 -0
  51. package/dist/cjs/{nv-sidebar.entry-inDVNJ4s.js → nv-sidebar.entry-BJrqJ8K7.js} +12 -8
  52. package/dist/cjs/nv-sidebarcontent.entry-CPfGF7nx.js +22 -0
  53. package/dist/cjs/{nv-sidebardivider.entry-D_yern0R.js → nv-sidebardivider.entry-D2wmzHCO.js} +4 -4
  54. package/dist/cjs/{nv-sidebarfooter.entry-Rkkn9TB_.js → nv-sidebarfooter.entry-C7fqCzjH.js} +4 -4
  55. package/dist/cjs/nv-sidebargroup.entry-qkXnxhs_.js +23 -0
  56. package/dist/cjs/{nv-sidebarheader.entry-CYpD_4pI.js → nv-sidebarheader.entry-DBsOmyQ0.js} +4 -4
  57. package/dist/cjs/{nv-sidebarlogo.entry-BgK03M1v.js → nv-sidebarlogo.entry-902Ht3UR.js} +4 -4
  58. package/dist/cjs/{nv-sidebarnavitem.entry-DglvcCOD.js → nv-sidebarnavitem.entry-CICrllp8.js} +11 -10
  59. package/dist/cjs/nv-sidebarnavsubitem.entry-Q9jjU_7D.js +35 -0
  60. package/dist/cjs/{nv-split.entry-mzg2F66T.js → nv-split.entry-BYIsE2wp.js} +51 -45
  61. package/dist/cjs/nv-stack.entry-DgE5ASGH.js +31 -0
  62. package/dist/cjs/{nv-table.entry-DkbNgxtI.js → nv-table.entry-DHXBu2n1.js} +9 -11
  63. package/dist/cjs/{nv-tableheader.entry-CRVFTQA-.js → nv-tableheader.entry-BijgOxcO.js} +5 -5
  64. package/dist/cjs/nv-toggle.entry-CMI1WdvV.js +82 -0
  65. package/dist/cjs/nv-togglebutton.entry-DAPETEmF.js +66 -0
  66. package/dist/cjs/{nv-togglebuttongroup.entry-BYXX5ejg.js → nv-togglebuttongroup.entry-CzDI1XCr.js} +14 -11
  67. package/dist/cjs/nv-tooltip.entry-DPoUP9iL.js +56 -0
  68. package/dist/cjs/slide.animation-CmH5d1of-BZuw607U.js +90 -0
  69. package/dist/components/NvDatatable/NvDatatable.js +69 -32
  70. package/dist/generated/components.js +38 -0
  71. package/dist/generated/components.server.js +120 -58
  72. package/dist/types/components/NvDatatable/NvDatatable.d.ts +1 -1
  73. package/dist/types/components/NvDatatable/types.d.ts +13 -3
  74. package/dist/types/generated/components.d.ts +63 -43
  75. package/dist/types/generated/components.server.d.ts +63 -43
  76. package/package.json +2 -2
  77. package/dist/cjs/index-CtjeeUI-.js +0 -39617
  78. package/dist/cjs/nv-avatar.entry-C_xZD3Lp.js +0 -68
  79. package/dist/cjs/nv-badge_2.entry-JjqANStV.js +0 -213
  80. package/dist/cjs/nv-breadcrumb.entry-DQZDn6cm.js +0 -46
  81. package/dist/cjs/nv-breadcrumbs.entry-Bz0GjhY_.js +0 -21
  82. package/dist/cjs/nv-button.entry-Br1DH9Vj.js +0 -164
  83. package/dist/cjs/nv-col.entry-CfgPMMxS.js +0 -38
  84. package/dist/cjs/nv-fieldcheckbox.entry-Bx6ArV_b.js +0 -177
  85. package/dist/cjs/nv-fielddropdownitem.entry-C_17isWd.js +0 -73
  86. package/dist/cjs/nv-fieldnumber.entry-C9O4UPp3.js +0 -187
  87. package/dist/cjs/nv-fieldpassword.entry-BfVJNT0A.js +0 -165
  88. package/dist/cjs/nv-fieldradio.entry-CG22oETM.js +0 -103
  89. package/dist/cjs/nv-fieldselect.entry-BPQEtrv2.js +0 -397
  90. package/dist/cjs/nv-fieldtext.entry-BD-z01ru.js +0 -163
  91. package/dist/cjs/nv-iconbutton_2.entry-CaKCa8NT.js +0 -168
  92. package/dist/cjs/nv-menuitem.entry-mKMqCAdz.js +0 -60
  93. package/dist/cjs/nv-notification-bullet.entry-DtbjtFxs.js +0 -77
  94. package/dist/cjs/nv-notification.entry-CLb0gNu3.js +0 -262
  95. package/dist/cjs/nv-notificationcontainer.entry-Cijivlm6.js +0 -41
  96. package/dist/cjs/nv-row.entry-C2C94fcv.js +0 -22
  97. package/dist/cjs/nv-sidebarcontent.entry-DxoljE15.js +0 -22
  98. package/dist/cjs/nv-sidebargroup.entry-C1p9qqxr.js +0 -23
  99. package/dist/cjs/nv-sidebarnavsubitem.entry-Dt1jKmC-.js +0 -35
  100. package/dist/cjs/nv-stack.entry-nnvjTrBy.js +0 -31
  101. package/dist/cjs/nv-toggle.entry-oC9TVkr1.js +0 -80
  102. package/dist/cjs/nv-togglebutton.entry-BTWCzbS9.js +0 -67
  103. package/dist/cjs/nv-tooltip.entry-OJGxfJEh.js +0 -55
@@ -0,0 +1,167 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-DUlunl9a.js');
4
+ var v4BdYh22OP = require('./v4-BdYh22OP-C1vaJ4yP.js');
5
+ require('@stencil/react-output-target/runtime');
6
+ require('react');
7
+ require('react-dom');
8
+
9
+ const nvFieldpasswordCss = () => `nv-fieldslider .slider-container .track-container:has(.thumb:hover) .track-range{background:var(--components-slider-track-filled-hover)}nv-fieldslider .slider-container .track-container:has(.thumb:hover) .thumb{border-color:var(--components-slider-track-filled-hover)}nv-fieldslider .slider-container .track-container:has(.thumb:focus) .track-range{background:var(--components-slider-track-filled-focus)}nv-fieldslider .slider-container .track-container:has(.thumb:focus) .thumb{border-color:var(--components-slider-track-filled-focus)}nv-fieldslider[error] .slider-container .track-container .track .track-range{background:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container .track .thumb{border-color:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container .track .thumb:hover{border-color:var(--components-slider-track-filled-error);outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-slider-track-filled-error);outline-offset:calc(var(--focus-outline-offset) * 1);background-color:var(--components-slider-handler-background-error)}nv-fieldslider[error] .slider-container .track-container .track .thumb:focus{border-color:var(--components-slider-track-filled-error);outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-slider-track-filled-error);outline-offset:calc(var(--focus-outline-offset) * 1);background-color:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container:has(.thumb:hover) .track-range{background:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container:has(.thumb:hover) .thumb{border-color:var(--components-slider-track-filled-error)}nv-fieldpassword{--nv-field-border-default:var(--components-form-field-border-default);--nv-field-border-hover:var(--components-form-field-border-hover);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--components-form-field-border-default);--nv-field-border-readonly:var(--components-form-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-brand);--nv-field-background:var(--components-form-field-background-default);display:flex;flex-direction:column;align-items:flex-start;gap:var(--form-gap-y);box-sizing:border-box;max-width:480px}nv-fieldpassword[fluid]:not([fluid=false]){max-width:unset}nv-fieldpassword[readonly]:not([readonly=false]){--nv-field-border-default:var(--components-form-field-border-readonly);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-background:var(--components-form-field-background-readonly)}nv-fieldpassword[error]:not([error=false]){--nv-field-border-default:var(--components-form-field-border-error);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--nv-field-border-default);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-destructive-in-field)}nv-fieldpassword[success]:not([success=false]){--nv-field-border-default:var(--components-form-field-border-success);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--nv-field-border-default);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-success)}nv-fieldpassword[required]:not([required=false]) label::after,nv-fieldpassword[aria-required=true] label::after{content:"*";color:var(--components-form-text-required);font-weight:var(--font-weight-high-emphasis)}nv-fieldpassword label{display:flex;align-items:center;gap:var(--form-label-gap);align-self:stretch;color:var(--components-form-text-label-default);font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-size:var(--form-label-font-size);font-style:normal;font-weight:var(--font-weight-medium-emphasis);line-height:var(--form-label-line-height)}nv-fieldpassword .input-wrapper{display:flex;flex-wrap:wrap;gap:var(--form-gap-x);align-items:stretch;align-self:stretch}nv-fieldpassword .input-wrapper .input-container{display:flex;flex-grow:1;justify-content:center;align-items:center;align-self:stretch;border-radius:var(--form-field-radius);border-width:1px;border-style:solid;border-color:var(--nv-field-border-default);opacity:var(--components-form-opacity-default, 1);background:var(--nv-field-background);transition:all 150ms ease-out}nv-fieldpassword .input-wrapper .input-container:hover{border-color:var(--nv-field-border-hover)}nv-fieldpassword .input-wrapper .input-container:focus-within,nv-fieldpassword .input-wrapper .input-container:focus-within:hover,nv-fieldpassword .input-wrapper .input-container:focus,nv-fieldpassword .input-wrapper .input-container:focus:hover{border-color:var(--nv-field-border-focus);box-shadow:0px 0px 0px var(--focus-field-stroke) var(--nv-field-focus-box-shadow)}nv-fieldpassword .input-wrapper .input-container:has(input:read-only){background-color:var(--components-form-field-background-readonly);border-color:var(--nv-field-border-readonly)}nv-fieldpassword .input-wrapper .input-container:has(input:disabled){opacity:0.5;background-color:var(--components-form-field-background-disabled);border-color:var(--nv-field-border-disabled)}nv-fieldpassword .input-wrapper .input-container{position:relative}nv-fieldpassword .input-wrapper .input-container input{display:flex;align-items:center;flex:1 0 0;overflow:hidden;background-color:transparent;color:var(--components-form-field-content-text);padding:calc(var(--form-field-padding-y) - 1px) var(--form-field-padding-x);font-size:var(--form-field-font-size);font-style:normal;font-weight:var(--font-weight-medium-emphasis);line-height:var(--form-field-line-height);width:100%}nv-fieldpassword .input-wrapper .input-container input:focus{outline:none}nv-fieldpassword .input-wrapper .input-container input::placeholder{overflow:hidden;color:var(--components-form-field-content-placeholder);text-overflow:ellipsis;font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-size:var(--form-field-font-size);font-style:normal;font-weight:var(--font-weight-low-emphasis);line-height:var(--form-field-line-height)}nv-fieldpassword .input-wrapper .input-container input{}nv-fieldpassword .input-wrapper .input-container input[type=password]::-ms-clear,nv-fieldpassword .input-wrapper .input-container input[type=password]::-ms-reveal{display:none;width:0;height:0}nv-fieldpassword .input-wrapper .input-container>nv-iconbutton{border:0px;border-radius:0px}nv-fieldpassword .input-wrapper .input-container>nv-iconbutton:focus-visible{border-radius:var(--button-md-border-radius);outline-offset:-3px}nv-fieldpassword .input-wrapper .input-container>nv-iconbutton:last-of-type{border-top-right-radius:var(--form-field-radius);border-bottom-right-radius:var(--form-field-radius)}nv-fieldpassword .input-wrapper .input-container nv-icon.validation{color:var(--nv-field-border-default)}nv-fieldpassword .description{display:flex;align-items:center;align-self:stretch;gap:var(--spacing-1);color:var(--components-form-text-description-default);font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height)}nv-fieldpassword .error-description{display:flex;align-items:center;align-self:stretch;gap:var(--spacing-1);color:var(--components-form-text-description-default);font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height);color:var(--components-form-text-description-error)}`;
10
+
11
+ const NvFieldpassword = class {
12
+ constructor(hostRef) {
13
+ index.registerInstance(this, hostRef);
14
+ this.valueChanged = index.createEvent(this, "valueChanged", 3);
15
+ /****************************************************************************/
16
+ //#region PROPERTIES
17
+ /**
18
+ * Sets the ID for the input element and the for attribute of the associated
19
+ * label. If no ID is provided, a random one will be automatically generated
20
+ * to ensure unique identification, facilitating proper label association and
21
+ * accessibility.
22
+ */
23
+ this.inputId = v4BdYh22OP.v4();
24
+ /**
25
+ * The disabled prop lets you turn off the input field so that users can’t
26
+ * type in it. When disabled, the field is grayed out and won’t respond to#
27
+ * clicks or touches.
28
+ */
29
+ this.disabled = false;
30
+ /**
31
+ * Display the input field’s content without allowing users to change it.
32
+ * Users can still click on it, select, and copy the text, but they won’t be
33
+ * able to type or delete anything.
34
+ */
35
+ this.readonly = false;
36
+ /**
37
+ * Marks the input field as required, ensuring that the user must fill it out
38
+ * before submitting the form.
39
+ * @note This uses the native HTML `required` attribute, which triggers browser validation.
40
+ */
41
+ this.required = false;
42
+ /**
43
+ * Marks the input field as required for accessibility purposes without triggering
44
+ * native HTML validation. Use this when implementing custom validation logic.
45
+ * @note When set, this uses `aria-required` instead of the native `required` attribute.
46
+ * This allows developers to implement custom validation while maintaining accessibility.
47
+ * @note If this prop is not explicitly set, the component will check for the HTML attribute
48
+ * 'aria-required' directly to determine if it should be applied.
49
+ */
50
+ this.ariaRequiredAttr = false;
51
+ /**
52
+ * Alters the input field's appearance to indicate an error, helping users
53
+ * identify fields that need correction.
54
+ * @validator error
55
+ */
56
+ this.error = false;
57
+ /**
58
+ * Changes the input field’s appearance to indicate successful input or
59
+ * validation.
60
+ */
61
+ this.success = false;
62
+ /**
63
+ * Defines the type of the input.
64
+ * @default 'text'
65
+ */
66
+ this.mode = 'text';
67
+ /**
68
+ * The autocomplete prop helps users fill out the input field faster by
69
+ * suggesting entries they’ve used before, like their email or address.
70
+ * You can turn it on to make forms more convenient or off to ensure users
71
+ * always type in fresh data.
72
+ */
73
+ this.autocomplete = 'off';
74
+ /**
75
+ * Hide the button to show/hide the password.
76
+ */
77
+ this.hidePasswordIcon = false;
78
+ /**
79
+ * Show/hide the password programmatically.
80
+ */
81
+ this.showPassword = false;
82
+ /**
83
+ * Applies focus to the input field as soon as the component is mounted. This
84
+ * is equivalent to setting the native autofocus attribute on an <input>
85
+ * element.
86
+ */
87
+ this.autofocus = false;
88
+ /**
89
+ * Allows the field to stretch and fill the entire width of its container.
90
+ */
91
+ this.fluid = false;
92
+ //#endregion EVENTS
93
+ /****************************************************************************/
94
+ //#region METHODS
95
+ this.handleInputContainerClick = () => {
96
+ this.inputElement.focus();
97
+ };
98
+ this.togglePasswordVisibility = () => {
99
+ this.showPasswordState = !this.showPasswordState;
100
+ };
101
+ this.handleInput = (event) => {
102
+ const input = event.target;
103
+ this.value = input.value; // Update the input value without worrying about the space
104
+ this.valueChanged.emit(input.value);
105
+ };
106
+ }
107
+ handleShowPasswordChange(newValue) {
108
+ this.showPasswordState = newValue;
109
+ }
110
+ //#endregion METHODS
111
+ /****************************************************************************/
112
+ //#region LIFECYCLE
113
+ componentWillLoad() {
114
+ this.showPasswordState = this.showPassword;
115
+ }
116
+ //#endregion LIFECYCLE
117
+ /****************************************************************************/
118
+ //#region RENDER
119
+ render() {
120
+ // Check aria-required from multiple sources:
121
+ // 1. JavaScript prop (most reliable)
122
+ // 2. HTML attribute 'aria-required' (direct HTML)
123
+ // 3. HTML attribute 'aria-required-attr' (from JSX kebab-case conversion)
124
+ // Check aria-required from multiple sources:
125
+ // 1. HTML attribute 'aria-required' (direct HTML) - check if explicitly set
126
+ // 2. JavaScript prop (when prop is explicitly set via JavaScript)
127
+ // We use hasAttribute to determine if the attribute was explicitly set by the user,
128
+ // since the prop now defaults to false (to maintain Blazor compatibility)
129
+ const hasAriaRequiredAttr = this.el.hasAttribute('aria-required') ||
130
+ this.el.hasAttribute('aria-required-attr');
131
+ const ariaRequiredFromAttr = hasAriaRequiredAttr
132
+ ? this.el.getAttribute('aria-required') ||
133
+ this.el.getAttribute('aria-required-attr')
134
+ : null;
135
+ // Use aria-required if the attribute was explicitly set
136
+ // With reflect: true, setting the prop will also set the attribute
137
+ const useAriaRequired = hasAriaRequiredAttr;
138
+ // Determine the value: use attribute if it exists (prop reflects to attribute via reflect: true)
139
+ // If attribute doesn't exist, the prop was never set and we don't use aria-required
140
+ const ariaRequiredAttrValue = hasAriaRequiredAttr
141
+ ? ariaRequiredFromAttr
142
+ : null;
143
+ // Determine which attributes to use
144
+ // If aria-required HTML attribute is present, use it (convert string to boolean)
145
+ // If required is set and aria-required is not "false", use native required
146
+ // If aria-required is "false", don't use native required even if required is set
147
+ const ariaRequiredValue = useAriaRequired
148
+ ? ariaRequiredAttrValue === 'true' || ariaRequiredAttrValue === ''
149
+ : undefined;
150
+ const useNativeRequired = this.required && (!useAriaRequired || ariaRequiredValue === true);
151
+ return (index.h(index.Host, { key: 'f9df0663358647d4305ebce0277cde70500e8740' }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: 'ac7f2c7c2351d231f95f1366fd562168172947e9', htmlFor: this.inputId }, index.h("slot", { key: 'bd816b47b2e5f396d075fef7162ced4a37fb218f', name: "label" }, this.label))), index.h("div", { key: '10e75900c29557bdb52d8ea6e44a44cf361fa3eb', class: "input-wrapper" }, index.h("slot", { key: '11f12897969247d96452d0c60f30634a8d3d1b65', name: "before-input" }), index.h("div", { key: '43a4dd389bde61fb42d71f9adf7fc3ae39b78937', class: "input-container", onClick: this.handleInputContainerClick }, index.h("slot", { key: '8831059e08707a3a14b19134189291f391ec1e06', name: "leading-input" }), index.h("input", { key: '06780d7a981405f5fbee6dafde3b044733ac381a', id: this.inputId, ref: e => (this.inputElement = e), autofocus: this.autofocus, autocomplete: this.autocomplete, placeholder: this.placeholder, name: this.name, type: this.showPasswordState ? 'text' : 'password', inputMode: this.mode, value: this.value, required: useNativeRequired ? this.required : undefined, ...(ariaRequiredValue !== undefined && {
152
+ 'aria-required': String(ariaRequiredValue),
153
+ }), maxlength: this.maxlength, minlength: this.minlength, pattern: this.pattern, disabled: this.disabled, readOnly: this.readonly, onInput: this.handleInput }), (this.success || this.error) && (index.h("nv-icon", { key: 'be4cb48eeb99a2a474cf7a6a53055e04d1baabff', name: this.success ? 'circle-check' : 'alert-circle', class: "validation", size: "md" })), !this.hidePasswordIcon && (index.h("nv-iconbutton", { key: '0749a349e7f7253c3574b1c5e8b45c27394cac31', name: this.showPasswordState ? 'eye' : 'eye-off', size: "md", emphasis: "lower", onClick: this.togglePasswordVisibility, "aria-label": this.showPasswordState ? 'Hide password' : 'Show password', "aria-pressed": this.showPasswordState.toString() }))), index.h("slot", { key: '045d8eae1db96d902e8590fab30673b782b41a24', name: "after-input" })), (this.description ||
154
+ this.el.querySelector('[slot="description"]')) && (index.h("div", { key: 'eb0305e565f4056fe0d8213caa5665e38fcbca95', class: "description" }, index.h("slot", { key: 'a6890087afa2b3d1a289e415bb9c21b7c71e9f04', name: "description" }, this.description))), (this.errorDescription ||
155
+ this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '4113509789b3bd7bd2f94217b68527f61449b262', hidden: !this.error, class: "error-description" }, index.h("slot", { key: '3ca63688c3db3ef4fe3b0d5d341b0b3536b1f692', name: "error-description" }, this.errorDescription)))));
156
+ }
157
+ static get formAssociated() { return true; }
158
+ get el() { return index.getElement(this); }
159
+ static get watchers() { return {
160
+ "showPassword": [{
161
+ "handleShowPasswordChange": 0
162
+ }]
163
+ }; }
164
+ };
165
+ NvFieldpassword.style = nvFieldpasswordCss();
166
+
167
+ exports.nv_fieldpassword = NvFieldpassword;
@@ -0,0 +1,105 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-DUlunl9a.js');
4
+ var clsxChV9xqsO = require('./clsx-ChV9xqsO-BtxeOLZW.js');
5
+ var v4BdYh22OP = require('./v4-BdYh22OP-C1vaJ4yP.js');
6
+ require('@stencil/react-output-target/runtime');
7
+ require('react');
8
+ require('react-dom');
9
+
10
+ const nvFieldradioCss = () => `nv-fieldradio{--nv-fieldradio-border-default:var(--components-form-field-border-default);--nv-fieldradio-border-hover:var(--components-form-field-border-hover);--nv-fieldradio-border-focus:var(--components-form-field-border-default);--nv-fieldradio-background-default:var(--components-form-field-background-default);--nv-fieldradio-background-checked:var(--components-form-field-background-checked);--nv-fieldradio-background-disabled:var(--components-form-field-background-disabled);--nv-fieldradio-focus-box-shadow:var(--color-focus-brand);--nv-fieldradio-dot-color-checked:var(--components-form-shape-foreground-default);--nv-fieldradio-dot-color-disabled:var(--components-form-shape-foreground-disabled);--nv-fieldradio-outline-color:var(--color-focus-brand);display:inline-flex;align-items:flex-start;gap:var(--form-gap-x)}nv-fieldradio:not([disabled]) input,nv-fieldradio:not([disabled]) label,nv-fieldradio[disabled=false] input,nv-fieldradio[disabled=false] label{cursor:pointer}nv-fieldradio.error{--nv-fieldradio-border-default:var(--components-form-field-border-error);--nv-fieldradio-border-hover:var(--nv-fieldradio-border-default);--nv-fieldradio-border-focus:var(--components-form-field-border-error);--nv-fieldradio-background-checked:var(--components-form-field-background-error);--nv-fieldradio-focus-box-shadow:var(--color-focus-destructive);--nv-fieldradio-dot-color-checked:var(--components-form-shape-foreground-default);--nv-fieldradio-dot-color-disabled:var(--components-form-field-border-error);--nv-fieldradio-outline-color:var(--color-focus-destructive)}nv-fieldradio.label-placement-before{flex-direction:row-reverse}nv-fieldradio[disabled]{opacity:0.5}nv-fieldradio label{align-self:stretch;color:var(--components-form-text-label-default);font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-size:var(--form-label-font-size);font-style:normal;font-weight:var(--form-label-font-weight);line-height:var(--form-label-line-height)}nv-fieldradio input[type=radio]{appearance:none;position:relative;display:flex;width:var(--form-radio-size);height:var(--form-radio-size);padding:var(--form-radio-inner-circle-padding);flex-direction:column;align-items:flex-start;border-radius:var(--radius-rounded-full);border-width:var(--form-radio-border-width);border-style:solid;border-color:var(--nv-fieldradio-border-default);background:var(--nv-fieldradio-background-default)}nv-fieldradio input[type=radio]:hover{border-color:var(--nv-fieldradio-border-hover)}nv-fieldradio input[type=radio]:focus{border-color:var(--nv-fieldradio-border-focus)}nv-fieldradio input[type=radio]:focus,nv-fieldradio input[type=radio]:focus-within{outline:none}nv-fieldradio input[type=radio]:focus-visible,nv-fieldradio input[type=radio]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--nv-fieldradio-outline-color);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-fieldradio input[type=radio]:checked{background:var(--nv-fieldradio-background-checked);border-color:var(--nv-fieldradio-background-checked)}nv-fieldradio input[type=radio]:checked:hover,nv-fieldradio input[type=radio]:checked:focus{border-color:var(--nv-fieldradio-background-checked);background:var(--nv-fieldradio-background-checked)}nv-fieldradio input[type=radio]:checked::before{content:"";position:absolute;top:50%;right:50%;transform:translate(50%, -50%);left:0;width:var(--form-radio-inner-circle-size);height:var(--form-radio-inner-circle-size);flex-shrink:0;border-radius:var(--radius-rounded-full);background:var(--nv-fieldradio-dot-color-checked)}nv-fieldradio input[type=radio]:disabled{border-radius:var(--radius-rounded-full);border-width:var(--form-radio-border-width);border-style:solid;border-color:var(--nv-fieldradio-border-default);background:var(--nv-fieldradio-background-disabled)}nv-fieldradio input[type=radio]:disabled:checked::before{background:var(--nv-fieldradio-dot-color-disabled)}nv-fieldradio input[type=radio]:disabled:hover{border-color:var(--nv-fieldradio-border-default);background:var(--nv-fieldradio-background-disabled)}nv-fieldradio .description{align-self:stretch;color:var(--components-form-text-description-default);font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-size:var(--form-description-font-size);font-style:normal;font-weight:var(--form-description-font-weight);line-height:var(--form-description-line-height)}nv-fieldradio .error-description{align-self:stretch;color:var(--components-form-text-description-default);font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-size:var(--form-description-font-size);font-style:normal;font-weight:var(--form-description-font-weight);line-height:var(--form-description-line-height);color:var(--components-form-text-description-error)}nv-fieldradio .text-container{display:flex;flex-direction:column;align-items:flex-start;flex:1 0 0}`;
11
+
12
+ const NvFieldradio = class {
13
+ constructor(hostRef) {
14
+ index.registerInstance(this, hostRef);
15
+ this.checkedChanged = index.createEvent(this, "checkedChanged", 3);
16
+ /**
17
+ * Set the label placement to before the input
18
+ * @deprecated use labelPlacement instead.
19
+ */
20
+ this.labelBefore = false;
21
+ //#endregion DEPRECATED
22
+ /****************************************************************************/
23
+ //#region PROPERTIES
24
+ /**
25
+ * Sets the ID for the radio button’s input element and the for attribute of
26
+ * the associated label. If no ID is provided, a random one will be
27
+ * automatically generated to ensure unique identification, facilitating
28
+ * proper label association and accessibility.
29
+ */
30
+ this.inputId = v4BdYh22OP.v4();
31
+ /**
32
+ * Highlight the radio button with error styling. It helps users quickly
33
+ * identify which option needs attention, improving their form-filling
34
+ * experience by making issues more visible.
35
+ * @validator error
36
+ */
37
+ this.error = false;
38
+ /**
39
+ * Controls whether the radio button is selected.
40
+ */
41
+ this.checked = false;
42
+ /**
43
+ * Disables the radio button, making it un-selectable.
44
+ */
45
+ this.disabled = false;
46
+ /**
47
+ * Applies focus to the input field as soon as the component is mounted. This
48
+ * is equivalent to setting the native autofocus attribute on an <input>
49
+ * element.
50
+ */
51
+ this.autofocus = false;
52
+ }
53
+ componentWillRender() {
54
+ if (this.message) {
55
+ this.description = this.message;
56
+ }
57
+ if (this.labelBefore) {
58
+ this.labelPlacement = 'before';
59
+ }
60
+ }
61
+ //#endregion EVENTS
62
+ /****************************************************************************/
63
+ //#region WATCHERS
64
+ /**
65
+ * Watches for changes to the checked state and emits the new value.
66
+ * @param {boolean} checked - The new value of the checked state.
67
+ */
68
+ handleCheckedChange(checked) {
69
+ this.checkedChanged.emit(checked);
70
+ }
71
+ /**
72
+ * Listens for the change event on the radio button input element and controls
73
+ * the checked state of the host elements.
74
+ * @param {Event} event - The change event.
75
+ */
76
+ handleChange(event) {
77
+ const target = event.target;
78
+ if (target?.type === 'radio') {
79
+ Array.from(document.getElementsByTagName('nv-fieldradio')).forEach(element => {
80
+ if (element.name === this.name) {
81
+ element.checked = false;
82
+ }
83
+ });
84
+ this.checked = target.checked;
85
+ }
86
+ }
87
+ //#endregion WATCHERS
88
+ /****************************************************************************/
89
+ //#region RENDER
90
+ render() {
91
+ return (index.h(index.Host, { key: 'bae8d6168e0845413655d8b52c14a2c348832616', class: clsxChV9xqsO.clsx(this.labelPlacement === 'before' && 'label-placement-before', this.error && 'error') }, index.h("input", { key: '4d3e7cd78625c3d42025f85be66c8f389501d01e', type: "radio", id: this.inputId, name: this.name, autofocus: this.autofocus, autocomplete: "off", value: this.value, checked: this.checked, disabled: this.disabled }), index.h("div", { key: '2d12f20bc8c0cf4bd3d31916bfeed8a8ef13de37', class: "text-container" }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: '91b2080433d987def3d2ddf45c9817cc5852ebee', htmlFor: this.inputId }, index.h("slot", { key: '61c2209353903495e30bc86a281b0460a8d1ee2e', name: "label" }, this.label))), (this.description ||
92
+ this.el.querySelector('[slot="description"]')) && (index.h("div", { key: 'f33b847894e5ea058ae36bb0fa107c5c28062443', class: "description" }, index.h("slot", { key: '24c4b14000b8dd0738b1c3fdc8c97aebc9f3c03f', name: "description" }, this.description))), (this.errorDescription ||
93
+ this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: 'bcc07ebfaa0d8dcd3c9a813ccd33322096b5aa82', hidden: !this.error, class: "error-description" }, index.h("slot", { key: '7cd0cb86be513924ccd83a3a93e4d8871ac21b7b', name: "error-description" }, this.errorDescription))))));
94
+ }
95
+ static get formAssociated() { return true; }
96
+ get el() { return index.getElement(this); }
97
+ static get watchers() { return {
98
+ "checked": [{
99
+ "handleCheckedChange": 0
100
+ }]
101
+ }; }
102
+ };
103
+ NvFieldradio.style = nvFieldradioCss();
104
+
105
+ exports.nv_fieldradio = NvFieldradio;