@ncds/ui-admin 1.8.21-alpha.0 β†’ 1.8.21-alpha.10

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 (134) hide show
  1. package/dist/cjs/assets/scripts/notification/FullWidthNotification.js +17 -6
  2. package/dist/cjs/assets/scripts/notification/MessageNotification.js +10 -48
  3. package/dist/cjs/assets/scripts/notification/const/classNames.js +3 -0
  4. package/dist/cjs/assets/scripts/notification/const/index.js +1 -1
  5. package/dist/cjs/assets/scripts/notification/const/sizes.js +4 -2
  6. package/dist/cjs/assets/scripts/notification/messageTemplate.js +106 -0
  7. package/dist/cjs/assets/scripts/notification/utils.js +40 -4
  8. package/dist/cjs/constant/notification.js +21 -0
  9. package/dist/cjs/src/components/forms-and-input/input-base/InputBase.js +52 -34
  10. package/dist/cjs/src/components/forms-and-input/input-base/__tests__/InputBase.test.js +228 -0
  11. package/dist/cjs/src/components/forms-and-input/password-input/PasswordInput.js +3 -2
  12. package/dist/cjs/src/components/forms-and-input/password-input/__tests__/PasswordInput.test.js +59 -0
  13. package/dist/cjs/src/components/index.js +22 -0
  14. package/dist/cjs/src/components/layout/ncua-scope/NcuaScope.js +79 -0
  15. package/dist/cjs/src/components/layout/ncua-scope/index.js +16 -0
  16. package/dist/cjs/src/components/navigation/pagination/Pagination.js +3 -1
  17. package/dist/cjs/src/components/navigation/pagination/__tests__/Pagination.test.js +74 -0
  18. package/dist/cjs/src/components/overlays/notification/FullWidthNotification.js +3 -1
  19. package/dist/cjs/src/components/overlays/notification/MessageNotification.js +14 -54
  20. package/dist/cjs/src/components/overlays/notification/MessageNotificationParts.js +92 -0
  21. package/dist/cjs/src/components/overlays/notification/__tests__/MessageNotification.test.js +246 -0
  22. package/dist/cjs/src/components/overlays/notification/__tests__/hidePermanentlyLabel.test.js +209 -0
  23. package/dist/cjs/src/components/overlays/postcode-search-modal/PostcodeSearchModal.js +259 -0
  24. package/dist/cjs/src/components/overlays/postcode-search-modal/PostcodeSearchModalTip.js +70 -0
  25. package/dist/cjs/src/components/overlays/postcode-search-modal/__tests__/PostcodeSearchModal.test.js +623 -0
  26. package/dist/cjs/src/components/overlays/postcode-search-modal/index.js +16 -0
  27. package/dist/cjs/src/generated/scoped-css.js +9 -0
  28. package/dist/esm/assets/scripts/notification/FullWidthNotification.js +17 -6
  29. package/dist/esm/assets/scripts/notification/MessageNotification.js +12 -50
  30. package/dist/esm/assets/scripts/notification/const/classNames.js +3 -0
  31. package/dist/esm/assets/scripts/notification/const/index.js +3 -2
  32. package/dist/esm/assets/scripts/notification/const/sizes.js +4 -2
  33. package/dist/esm/assets/scripts/notification/messageTemplate.js +100 -0
  34. package/dist/esm/assets/scripts/notification/utils.js +39 -4
  35. package/dist/esm/constant/notification.js +15 -0
  36. package/dist/esm/src/components/forms-and-input/input-base/InputBase.js +52 -34
  37. package/dist/esm/src/components/forms-and-input/input-base/__tests__/InputBase.test.js +228 -0
  38. package/dist/esm/src/components/forms-and-input/password-input/PasswordInput.js +3 -2
  39. package/dist/esm/src/components/forms-and-input/password-input/__tests__/PasswordInput.test.js +56 -0
  40. package/dist/esm/src/components/index.js +2 -0
  41. package/dist/esm/src/components/layout/ncua-scope/NcuaScope.js +73 -0
  42. package/dist/esm/src/components/layout/ncua-scope/index.js +1 -0
  43. package/dist/esm/src/components/navigation/pagination/Pagination.js +3 -1
  44. package/dist/esm/src/components/navigation/pagination/__tests__/Pagination.test.js +74 -0
  45. package/dist/esm/src/components/overlays/notification/FullWidthNotification.js +3 -1
  46. package/dist/esm/src/components/overlays/notification/MessageNotification.js +15 -55
  47. package/dist/esm/src/components/overlays/notification/MessageNotificationParts.js +85 -0
  48. package/dist/esm/src/components/overlays/notification/__tests__/MessageNotification.test.js +243 -0
  49. package/dist/esm/src/components/overlays/notification/__tests__/hidePermanentlyLabel.test.js +206 -0
  50. package/dist/esm/src/components/overlays/postcode-search-modal/PostcodeSearchModal.js +252 -0
  51. package/dist/esm/src/components/overlays/postcode-search-modal/PostcodeSearchModalTip.js +63 -0
  52. package/dist/esm/src/components/overlays/postcode-search-modal/__tests__/PostcodeSearchModal.test.js +620 -0
  53. package/dist/esm/src/components/overlays/postcode-search-modal/index.js +1 -0
  54. package/dist/esm/src/generated/scoped-css.js +3 -0
  55. package/dist/temp/assets/scripts/notification/FullWidthNotification.d.ts +6 -0
  56. package/dist/temp/assets/scripts/notification/FullWidthNotification.js +14 -5
  57. package/dist/temp/assets/scripts/notification/MessageNotification.d.ts +0 -3
  58. package/dist/temp/assets/scripts/notification/MessageNotification.js +9 -44
  59. package/dist/temp/assets/scripts/notification/const/classNames.d.ts +1 -0
  60. package/dist/temp/assets/scripts/notification/const/classNames.js +3 -0
  61. package/dist/temp/assets/scripts/notification/const/index.d.ts +3 -3
  62. package/dist/temp/assets/scripts/notification/const/index.js +3 -2
  63. package/dist/temp/assets/scripts/notification/const/sizes.d.ts +2 -2
  64. package/dist/temp/assets/scripts/notification/const/sizes.js +4 -2
  65. package/dist/temp/assets/scripts/notification/const/types.d.ts +30 -2
  66. package/dist/temp/assets/scripts/notification/messageTemplate.d.ts +15 -0
  67. package/dist/temp/assets/scripts/notification/messageTemplate.js +79 -0
  68. package/dist/temp/assets/scripts/notification/utils.d.ts +19 -2
  69. package/dist/temp/assets/scripts/notification/utils.js +39 -5
  70. package/dist/temp/constant/notification.d.ts +15 -0
  71. package/dist/temp/constant/notification.js +15 -0
  72. package/dist/temp/src/components/forms-and-input/input-base/InputBase.d.ts +1 -1
  73. package/dist/temp/src/components/forms-and-input/input-base/InputBase.js +43 -26
  74. package/dist/temp/src/components/forms-and-input/input-base/__tests__/InputBase.test.js +174 -0
  75. package/dist/temp/src/components/forms-and-input/password-input/PasswordInput.js +2 -1
  76. package/dist/temp/src/components/forms-and-input/password-input/__tests__/PasswordInput.test.d.ts +1 -0
  77. package/dist/temp/src/components/forms-and-input/password-input/__tests__/PasswordInput.test.js +48 -0
  78. package/dist/temp/src/components/index.d.ts +2 -0
  79. package/dist/temp/src/components/index.js +2 -0
  80. package/dist/temp/src/components/layout/ncua-scope/NcuaScope.d.ts +32 -0
  81. package/dist/temp/src/components/layout/ncua-scope/NcuaScope.js +51 -0
  82. package/dist/temp/src/components/layout/ncua-scope/index.d.ts +1 -0
  83. package/dist/temp/src/components/layout/ncua-scope/index.js +1 -0
  84. package/dist/temp/src/components/navigation/pagination/Pagination.js +3 -1
  85. package/dist/temp/src/components/navigation/pagination/__tests__/Pagination.test.js +74 -0
  86. package/dist/temp/src/components/overlays/notification/FullWidthNotification.d.ts +6 -0
  87. package/dist/temp/src/components/overlays/notification/FullWidthNotification.js +3 -2
  88. package/dist/temp/src/components/overlays/notification/MessageNotification.d.ts +6 -0
  89. package/dist/temp/src/components/overlays/notification/MessageNotification.js +4 -13
  90. package/dist/temp/src/components/overlays/notification/MessageNotificationParts.d.ts +28 -0
  91. package/dist/temp/src/components/overlays/notification/MessageNotificationParts.js +28 -0
  92. package/dist/temp/src/components/overlays/notification/Notification.d.ts +11 -2
  93. package/dist/temp/src/components/overlays/notification/__tests__/MessageNotification.test.d.ts +1 -0
  94. package/dist/temp/src/components/overlays/notification/__tests__/MessageNotification.test.js +190 -0
  95. package/dist/temp/src/components/overlays/notification/__tests__/hidePermanentlyLabel.test.d.ts +1 -0
  96. package/dist/temp/src/components/overlays/notification/__tests__/hidePermanentlyLabel.test.js +160 -0
  97. package/dist/temp/src/components/overlays/postcode-search-modal/PostcodeSearchModal.d.ts +45 -0
  98. package/dist/temp/src/components/overlays/postcode-search-modal/PostcodeSearchModal.js +125 -0
  99. package/dist/temp/src/components/overlays/postcode-search-modal/PostcodeSearchModalTip.d.ts +16 -0
  100. package/dist/temp/src/components/overlays/postcode-search-modal/PostcodeSearchModalTip.js +24 -0
  101. package/dist/temp/src/components/overlays/postcode-search-modal/__tests__/PostcodeSearchModal.test.d.ts +1 -0
  102. package/dist/temp/src/components/overlays/postcode-search-modal/__tests__/PostcodeSearchModal.test.js +503 -0
  103. package/dist/temp/src/components/overlays/postcode-search-modal/index.d.ts +1 -0
  104. package/dist/temp/src/components/overlays/postcode-search-modal/index.js +1 -0
  105. package/dist/temp/src/generated/scoped-css.d.ts +1 -0
  106. package/dist/temp/src/generated/scoped-css.js +3 -0
  107. package/dist/types/assets/scripts/notification/FullWidthNotification.d.ts +6 -0
  108. package/dist/types/assets/scripts/notification/MessageNotification.d.ts +0 -3
  109. package/dist/types/assets/scripts/notification/const/classNames.d.ts +1 -0
  110. package/dist/types/assets/scripts/notification/const/index.d.ts +3 -3
  111. package/dist/types/assets/scripts/notification/const/sizes.d.ts +2 -2
  112. package/dist/types/assets/scripts/notification/const/types.d.ts +30 -2
  113. package/dist/types/assets/scripts/notification/messageTemplate.d.ts +15 -0
  114. package/dist/types/assets/scripts/notification/utils.d.ts +19 -2
  115. package/dist/types/constant/notification.d.ts +15 -0
  116. package/dist/types/src/components/forms-and-input/input-base/InputBase.d.ts +1 -1
  117. package/dist/types/src/components/forms-and-input/password-input/__tests__/PasswordInput.test.d.ts +1 -0
  118. package/dist/types/src/components/index.d.ts +2 -0
  119. package/dist/types/src/components/layout/ncua-scope/NcuaScope.d.ts +32 -0
  120. package/dist/types/src/components/layout/ncua-scope/index.d.ts +1 -0
  121. package/dist/types/src/components/overlays/notification/FullWidthNotification.d.ts +6 -0
  122. package/dist/types/src/components/overlays/notification/MessageNotification.d.ts +6 -0
  123. package/dist/types/src/components/overlays/notification/MessageNotificationParts.d.ts +28 -0
  124. package/dist/types/src/components/overlays/notification/Notification.d.ts +11 -2
  125. package/dist/types/src/components/overlays/notification/__tests__/MessageNotification.test.d.ts +1 -0
  126. package/dist/types/src/components/overlays/notification/__tests__/hidePermanentlyLabel.test.d.ts +1 -0
  127. package/dist/types/src/components/overlays/postcode-search-modal/PostcodeSearchModal.d.ts +45 -0
  128. package/dist/types/src/components/overlays/postcode-search-modal/PostcodeSearchModalTip.d.ts +16 -0
  129. package/dist/types/src/components/overlays/postcode-search-modal/__tests__/PostcodeSearchModal.test.d.ts +1 -0
  130. package/dist/types/src/components/overlays/postcode-search-modal/index.d.ts +1 -0
  131. package/dist/types/src/generated/scoped-css.d.ts +1 -0
  132. package/dist/ui-admin/assets/styles/style.css +296 -56
  133. package/dist/ui-admin/assets/styles/style.scoped.css +8595 -0
  134. package/package.json +13 -6
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
 
3
+ var _uiAdminIcon = require("@ncds/ui-admin-icon");
3
4
  var _react = require("react");
4
5
  var _client = require("react-dom/client");
5
6
  var _testUtils = require("react-dom/test-utils");
6
7
  var _vitest = require("vitest");
8
+ var _color = require("../../../../../constant/color");
7
9
  var _InputBase = require("../InputBase");
8
10
  // @vitest-environment jsdom
9
11
 
@@ -69,4 +71,230 @@ function mountInputBase() {
69
71
  (0, _vitest.expect)(view.container.querySelector('.ncua-input__clear')).toBeNull();
70
72
  view.unmount();
71
73
  });
74
+ });
75
+ (0, _vitest.describe)('InputBase β€” μ•„μ΄μ½˜ μ‚¬μ΄μ¦ˆ', () => {
76
+ const iconSizeOf = (container, selector) => {
77
+ const svg = container.querySelector(selector);
78
+ return {
79
+ width: svg?.getAttribute('width'),
80
+ height: svg?.getAttribute('height')
81
+ };
82
+ };
83
+ // 슬둯 μ•„μ΄μ½˜κ³Ό μƒνƒœ μ•„μ΄μ½˜μ€ 같은 크기λ₯Ό μ“΄λ‹€ β€” κ³Όκ±° μƒνƒœ μ•„μ΄μ½˜λ§Œ sm=16으둜 μ–΄κΈ‹λ‚˜ μžˆμ—ˆλ‹€
84
+ _vitest.it.each([['xs', '14'], ['sm', '20']])('size=%s 일 λ•Œ 슬둯 μ•„μ΄μ½˜κ³Ό μƒνƒœ μ•„μ΄μ½˜μ΄ λͺ¨λ‘ %spx둜 λ Œλ”λœλ‹€', (size, expected) => {
85
+ // Given/When: 슬둯 μ•„μ΄μ½˜κ³Ό clear λ²„νŠΌ, destructive μƒνƒœλ₯Ό ν•¨κ»˜ λ Œλ”ν•˜λ©΄
86
+ const view = mountInputBase({
87
+ size,
88
+ destructive: true,
89
+ clearText: true,
90
+ onClearText: _vitest.vi.fn(),
91
+ leadingElement: {
92
+ type: 'icon',
93
+ icon: _uiAdminIcon.SearchLg
94
+ }
95
+ });
96
+ // Then: 슬둯·clearΒ·destructive μ•„μ΄μ½˜μ˜ 크기가 μ„œλ‘œ μ–΄κΈ‹λ‚˜μ§€ μ•ŠλŠ”λ‹€
97
+ const expectedSize = {
98
+ width: expected,
99
+ height: expected
100
+ };
101
+ (0, _vitest.expect)(iconSizeOf(view.container, '.ncua-input__left-icon')).toEqual(expectedSize);
102
+ (0, _vitest.expect)(iconSizeOf(view.container, '.ncua-input__clear-icon')).toEqual(expectedSize);
103
+ (0, _vitest.expect)(iconSizeOf(view.container, '.ncua-input__destructive-icon')).toEqual(expectedSize);
104
+ view.unmount();
105
+ });
106
+ _vitest.it.each([['xs', '14'], ['sm', '20']])('size=%s 일 λ•Œ validation μ•„μ΄μ½˜λ„ %spx둜 λ Œλ”λœλ‹€', (size, expected) => {
107
+ // Given/When: validation μƒνƒœλ‘œ λ Œλ”ν•˜λ©΄
108
+ const view = mountInputBase({
109
+ size,
110
+ validation: true
111
+ });
112
+ // Then: λ‹€λ₯Έ μ•„μ΄μ½˜κ³Ό 같은 크기닀
113
+ (0, _vitest.expect)(iconSizeOf(view.container, '.ncua-input__validation-icon')).toEqual({
114
+ width: expected,
115
+ height: expected
116
+ });
117
+ view.unmount();
118
+ });
119
+ (0, _vitest.it)('slot.sizeλ₯Ό 직접 μ£Όλ©΄ κΈ°λ³Έ μ‚¬μ΄μ¦ˆλ³΄λ‹€ μš°μ„ ν•œλ‹€', () => {
120
+ // Given/When: μŠ¬λ‘―μ— sizeλ₯Ό λͺ…μ‹œν•΄ λ Œλ”ν•˜λ©΄
121
+ const view = mountInputBase({
122
+ size: 'xs',
123
+ leadingElement: {
124
+ type: 'icon',
125
+ icon: _uiAdminIcon.SearchLg,
126
+ size: 24
127
+ }
128
+ });
129
+ // Then: κΈ°λ³Έκ°’(14)이 μ•„λ‹ˆλΌ λͺ…μ‹œν•œ 값이 μ μš©λœλ‹€
130
+ (0, _vitest.expect)(iconSizeOf(view.container, '.ncua-input__left-icon')).toEqual({
131
+ width: '24',
132
+ height: '24'
133
+ });
134
+ view.unmount();
135
+ });
136
+ });
137
+ (0, _vitest.describe)('InputBase β€” 슬둯 μ•„μ΄μ½˜ μƒνƒœ 색상', () => {
138
+ // μƒνƒœλ³„ 색은 CSS κ°€ κ²°μ •ν•œλ‹€. jsdom μ—μ„œλŠ” μŠ€νƒ€μΌμ‹œνŠΈλ₯Ό λ‘œλ“œν•˜μ§€ μ•ŠμœΌλ―€λ‘œ
139
+ // "μƒνƒœ κ·œμΉ™μ„ νƒ€λŠ” ν΄λž˜μŠ€κ°€ λΆ™μ—ˆλŠ”μ§€" 와 "μ§€μ • 색이 인라인으둜 λ‚¨μ•˜λŠ”μ§€" 둜 κ²€μ¦ν•œλ‹€.
140
+ const leftIconOf = container => container.querySelector('.ncua-input__left-icon');
141
+ (0, _vitest.it)('color λ₯Ό μ§€μ •ν•˜μ§€ μ•ŠμœΌλ©΄ μƒνƒœ 색상 ν΄λž˜μŠ€κ°€ λΆ™λŠ”λ‹€', () => {
142
+ // Given/When: color 없이 슬둯 μ•„μ΄μ½˜μ„ λ Œλ”ν•˜λ©΄
143
+ const view = mountInputBase({
144
+ leadingElement: {
145
+ type: 'icon',
146
+ icon: _uiAdminIcon.SearchLg
147
+ }
148
+ });
149
+ // Then: μƒνƒœ κ·œμΉ™μ„ νƒ€λŠ” ν΄λž˜μŠ€κ°€ λΆ™κ³ , 인라인 색은 μ§€μ •λ˜μ§€ μ•ŠλŠ”λ‹€
150
+ const icon = leftIconOf(view.container);
151
+ (0, _vitest.expect)(icon?.classList.contains('ncua-input__slot-icon')).toBe(true);
152
+ (0, _vitest.expect)(icon?.hasAttribute('color')).toBe(false);
153
+ view.unmount();
154
+ });
155
+ (0, _vitest.it)('color λ₯Ό μ§€μ •ν•˜λ©΄ μƒνƒœ 색상 ν΄λž˜μŠ€κ°€ λΆ™μ§€ μ•Šκ³  μ§€μ • 색이 μœ μ§€λœλ‹€', () => {
156
+ // Given/When: color λ₯Ό μ§€μ •ν•΄ λ Œλ”ν•˜λ©΄
157
+ const view = mountInputBase({
158
+ leadingElement: {
159
+ type: 'icon',
160
+ icon: _uiAdminIcon.SearchLg,
161
+ color: 'blue500'
162
+ }
163
+ });
164
+ // Then: μƒνƒœ κ·œμΉ™μ—μ„œ μ œμ™Έλ˜κ³  μ§€μ •ν•œ 색이 κ·ΈλŒ€λ‘œ λ‚¨λŠ”λ‹€
165
+ const icon = leftIconOf(view.container);
166
+ (0, _vitest.expect)(icon?.classList.contains('ncua-input__slot-icon')).toBe(false);
167
+ (0, _vitest.expect)(icon?.getAttribute('color')).toBe(_color.COLOR.blue500);
168
+ view.unmount();
169
+ });
170
+ (0, _vitest.it)('slot.className 을 ν•¨κ»˜ 주어도 μƒνƒœ 색상 ν΄λž˜μŠ€κ°€ μœ μ§€λœλ‹€', () => {
171
+ // Given/When: className 을 μΆ”κ°€λ‘œ λ„˜κΈ°λ©΄
172
+ const view = mountInputBase({
173
+ leadingElement: {
174
+ type: 'icon',
175
+ icon: _uiAdminIcon.SearchLg,
176
+ className: 'my-icon'
177
+ }
178
+ });
179
+ // Then: 두 ν΄λž˜μŠ€κ°€ λͺ¨λ‘ λΆ™λŠ”λ‹€
180
+ const icon = leftIconOf(view.container);
181
+ (0, _vitest.expect)(icon?.classList.contains('ncua-input__slot-icon')).toBe(true);
182
+ (0, _vitest.expect)(icon?.classList.contains('my-icon')).toBe(true);
183
+ view.unmount();
184
+ });
185
+ });
186
+ (0, _vitest.describe)('InputBase β€” has-value μƒνƒœ 클래슀', () => {
187
+ const typeInto = (container, text) => {
188
+ const input = container.querySelector('input');
189
+ if (!input) throw new Error('input이 λ Œλ”λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€');
190
+ (0, _testUtils.act)(() => {
191
+ input.value = text;
192
+ input.dispatchEvent(new Event('input', {
193
+ bubbles: true
194
+ }));
195
+ });
196
+ };
197
+ (0, _vitest.it)('값이 λΉ„μ–΄ 있으면 has-valueκ°€ λΆ™μ§€ μ•ŠλŠ”λ‹€', () => {
198
+ // Given/When: 빈 μƒνƒœλ‘œ λ Œλ”ν•˜λ©΄
199
+ const view = mountInputBase();
200
+ // Then: λ£¨νŠΈμ— has-valueκ°€ μ—†λ‹€
201
+ (0, _vitest.expect)(view.container.querySelector('.ncua-input')?.classList.contains('has-value')).toBe(false);
202
+ view.unmount();
203
+ });
204
+ // props.value 둜 νŒμ •ν•˜λ©΄ uncontrolled μ—μ„œ μ˜μ›νžˆ 빈 κ°’μœΌλ‘œ 보인닀 β€” μžλ¬Όμ‡  μ•„μ΄μ½˜ 색상이 λ°˜μ˜λ˜μ§€ μ•Šλ˜ 원인
205
+ (0, _vitest.it)('uncontrolled Input에 μž…λ ₯ν•˜λ©΄ has-valueκ°€ λΆ™λŠ”λ‹€', () => {
206
+ // Given: valueλ₯Ό λ„˜κΈ°μ§€ μ•Šμ€ uncontrolled μƒνƒœμ—μ„œ
207
+ const view = mountInputBase();
208
+ // When: μ‹€μ œλ‘œ μž…λ ₯ν•˜λ©΄
209
+ typeInto(view.container, 'hello');
210
+ // Then: has-valueκ°€ λΆ™λŠ”λ‹€
211
+ (0, _vitest.expect)(view.container.querySelector('.ncua-input')?.classList.contains('has-value')).toBe(true);
212
+ view.unmount();
213
+ });
214
+ (0, _vitest.it)('μž…λ ₯값을 μ§€μš°λ©΄ has-valueκ°€ λ–¨μ–΄μ§„λ‹€', () => {
215
+ // Given: 값이 μžˆλŠ” μƒνƒœμ—μ„œ
216
+ const view = mountInputBase();
217
+ typeInto(view.container, 'hello');
218
+ // When: 값을 λΉ„μš°λ©΄
219
+ typeInto(view.container, '');
220
+ // Then: has-valueκ°€ 사라진닀
221
+ (0, _vitest.expect)(view.container.querySelector('.ncua-input')?.classList.contains('has-value')).toBe(false);
222
+ view.unmount();
223
+ });
224
+ (0, _vitest.it)('controlled Input은 value propλ§ŒμœΌλ‘œλ„ has-valueκ°€ λΆ™λŠ”λ‹€', () => {
225
+ // Given/When: valueλ₯Ό 직접 λ„˜κ²¨ λ Œλ”ν•˜λ©΄ (input 이벀트 없이)
226
+ const view = mountInputBase({
227
+ value: 'preset',
228
+ onChange: _vitest.vi.fn()
229
+ });
230
+ // Then: has-valueκ°€ λΆ™λŠ”λ‹€
231
+ (0, _vitest.expect)(view.container.querySelector('.ncua-input')?.classList.contains('has-value')).toBe(true);
232
+ view.unmount();
233
+ });
234
+ });
235
+ (0, _vitest.describe)('InputBase β€” ν…μŠ€νŠΈ 슬둯', () => {
236
+ (0, _vitest.it)('leadingElement ν…μŠ€νŠΈλŠ” leading ν΄λž˜μŠ€μ™€ wrap ν΄λž˜μŠ€κ°€ λΆ™λŠ”λ‹€', () => {
237
+ const {
238
+ container,
239
+ unmount
240
+ } = mountInputBase({
241
+ leadingElement: {
242
+ type: 'text',
243
+ text: 'https://'
244
+ }
245
+ });
246
+ const text = container.querySelector('.ncua-input__leading-text');
247
+ (0, _vitest.expect)(text?.textContent).toBe('https://');
248
+ (0, _vitest.expect)(container.querySelector('.ncua-input__leading-text-wrap')).not.toBeNull();
249
+ unmount();
250
+ });
251
+ (0, _vitest.it)('trailingElement ν…μŠ€νŠΈλŠ” trailing ν΄λž˜μŠ€μ™€ wrap ν΄λž˜μŠ€κ°€ λΆ™λŠ”λ‹€', () => {
252
+ const {
253
+ container,
254
+ unmount
255
+ } = mountInputBase({
256
+ trailingElement: {
257
+ type: 'text',
258
+ text: 'px'
259
+ }
260
+ });
261
+ const text = container.querySelector('.ncua-input__trailing-text');
262
+ (0, _vitest.expect)(text?.textContent).toBe('px');
263
+ (0, _vitest.expect)(container.querySelector('.ncua-input__trailing-text-wrap')).not.toBeNull();
264
+ // leading ν΄λž˜μŠ€κ°€ μ„žμ΄λ©΄ λͺ¨μ„œλ¦¬Β·ν…Œλ‘λ¦¬ λ°©ν–₯이 λ°˜λŒ€κ°€ λœλ‹€
265
+ (0, _vitest.expect)(container.querySelector('.ncua-input__leading-text')).toBeNull();
266
+ unmount();
267
+ });
268
+ (0, _vitest.it)('trailingElement ν…μŠ€νŠΈλŠ” μž…λ ₯ ν•„λ“œ 뒀에 μ˜¨λ‹€', () => {
269
+ const {
270
+ container,
271
+ unmount
272
+ } = mountInputBase({
273
+ trailingElement: {
274
+ type: 'text',
275
+ text: 'px'
276
+ }
277
+ });
278
+ const content = container.querySelector('.ncua-input__content');
279
+ const children = Array.from(content?.children ?? []);
280
+ const fieldIndex = children.findIndex(el => el.classList.contains('ncua-input__field'));
281
+ const textIndex = children.findIndex(el => el.classList.contains('ncua-input__trailing-text'));
282
+ (0, _vitest.expect)(fieldIndex).toBeGreaterThanOrEqual(0);
283
+ (0, _vitest.expect)(textIndex).toBeGreaterThan(fieldIndex);
284
+ unmount();
285
+ });
286
+ (0, _vitest.it)('μ‚¬μ΄μ¦ˆ modifier κ°€ ν•¨κ»˜ λΆ™λŠ”λ‹€', () => {
287
+ const {
288
+ container,
289
+ unmount
290
+ } = mountInputBase({
291
+ size: 'sm',
292
+ trailingElement: {
293
+ type: 'text',
294
+ text: 'px'
295
+ }
296
+ });
297
+ (0, _vitest.expect)(container.querySelector('.ncua-input__trailing-text--sm')).not.toBeNull();
298
+ unmount();
299
+ });
72
300
  });
@@ -33,8 +33,9 @@ const PasswordInput = exports.PasswordInput = /*#__PURE__*/(0, _react.forwardRef
33
33
  type: isVisible ? 'text' : 'password',
34
34
  leadingElement: {
35
35
  type: 'icon',
36
- icon: _uiAdminIcon.Lock01,
37
- color: props.value ? 'gray600' : 'gray300'
36
+ icon: _uiAdminIcon.Lock01
37
+ // color λ₯Ό λ„˜κΈ°μ§€ μ•Šμ•„ 슬둯 μ•„μ΄μ½˜ 곡톡 κ·œμΉ™(μƒνƒœλ³„ 색)을 κ·ΈλŒ€λ‘œ λ”°λ₯Έλ‹€.
38
+ // μ—¬κΈ°μ„œ props.value 둜 νŒμ •ν•˜λ©΄ uncontrolled Input μ—μ„œ μ˜μ›νžˆ 빈 κ°’ μ·¨κΈ‰λœλ‹€.
38
39
  },
39
40
  trailingElement: {
40
41
  type: 'custom',
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+
3
+ var _react = require("react");
4
+ var _client = require("react-dom/client");
5
+ var _testUtils = require("react-dom/test-utils");
6
+ var _vitest = require("vitest");
7
+ var _PasswordInput = require("../PasswordInput");
8
+ // @vitest-environment jsdom
9
+
10
+ // React 18μ—μ„œ act() μ‚¬μš© μ‹œ ν•„μš”ν•œ ν”Œλž˜κ·Έ (λ―Έμ„€μ • μ‹œ console.error κ²½κ³  λ°œμƒ)
11
+ globalThis.IS_REACT_ACT_ENVIRONMENT = true;
12
+ function mountPasswordInput() {
13
+ let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
14
+ const container = document.createElement('div');
15
+ document.body.appendChild(container);
16
+ const root = (0, _client.createRoot)(container);
17
+ (0, _testUtils.act)(() => {
18
+ root.render(/*#__PURE__*/(0, _react.createElement)(_PasswordInput.PasswordInput, props));
19
+ });
20
+ const unmount = () => {
21
+ (0, _testUtils.act)(() => {
22
+ root.unmount();
23
+ });
24
+ container.remove();
25
+ };
26
+ return {
27
+ container,
28
+ unmount
29
+ };
30
+ }
31
+ (0, _vitest.describe)('PasswordInput β€” μžλ¬Όμ‡  μ•„μ΄μ½˜ 색상', () => {
32
+ // μžλ¬Όμ‡  색은 CSS κ°€ κ²°μ •ν•œλ‹€. 인라인 color λ₯Ό λ„˜κΈ°λ©΄ μƒνƒœ κ·œμΉ™μ΄ λ¬΄μ‹œλ˜λ―€λ‘œ,
33
+ // "인라인 색이 μ—†κ³  슬둯 μ•„μ΄μ½˜ 곡톡 클래슀λ₯Ό 탄닀" λŠ” 것이 색상 반영의 μ „μ œλ‹€.
34
+ (0, _vitest.it)('μžλ¬Όμ‡ μ— 인라인 색을 λ„˜κΈ°μ§€ μ•Šκ³  슬둯 μ•„μ΄μ½˜ 곡톡 클래슀λ₯Ό 탄닀', () => {
35
+ // Given/When: κΈ°λ³Έ μƒνƒœλ‘œ λ Œλ”ν•˜λ©΄
36
+ const view = mountPasswordInput();
37
+ // Then: μƒνƒœ κ·œμΉ™μ„ νƒ€λŠ” ν΄λž˜μŠ€κ°€ λΆ™κ³  인라인 색은 μ—†λ‹€
38
+ const lockIcon = view.container.querySelector('.ncua-input__left-icon');
39
+ (0, _vitest.expect)(lockIcon).not.toBeNull();
40
+ (0, _vitest.expect)(lockIcon?.classList.contains('ncua-input__slot-icon')).toBe(true);
41
+ (0, _vitest.expect)(lockIcon?.hasAttribute('color')).toBe(false);
42
+ view.unmount();
43
+ });
44
+ // 값이 μžˆλŠ” μ±„λ‘œ λΉ„ν™œμ„±ν™”λ˜λ©΄ has-value κ°€ μ‚΄μ•„ μžˆμ–΄ μžλ¬Όμ‡ κ°€ μ§„ν•˜κ²Œ λ‚¨λ˜ 문제
45
+ (0, _vitest.it)('값이 μžˆλŠ” μ±„λ‘œ disabled 여도 μžλ¬Όμ‡ κ°€ μƒνƒœ κ·œμΉ™ λŒ€μƒμœΌλ‘œ λ‚¨λŠ”λ‹€', () => {
46
+ // Given/When: 값이 μžˆλŠ” λΉ„ν™œμ„±ν™” μƒνƒœλ‘œ λ Œλ”ν•˜λ©΄
47
+ const view = mountPasswordInput({
48
+ value: 'secret',
49
+ disabled: true,
50
+ onChange: _vitest.vi.fn()
51
+ });
52
+ // Then: λ£¨νŠΈμ— is-disabled 와 has-value κ°€ ν•¨κ»˜ λΆ™κ³ , μžλ¬Όμ‡ λŠ” 곡톡 클래슀λ₯Ό μœ μ§€ν•œλ‹€
53
+ const root = view.container.querySelector('.ncua-input');
54
+ (0, _vitest.expect)(root?.classList.contains('is-disabled')).toBe(true);
55
+ (0, _vitest.expect)(root?.classList.contains('has-value')).toBe(true);
56
+ (0, _vitest.expect)(view.container.querySelector('.ncua-input__left-icon')?.classList.contains('ncua-input__slot-icon')).toBe(true);
57
+ view.unmount();
58
+ });
59
+ });
@@ -388,6 +388,17 @@ Object.keys(_divider).forEach(function (key) {
388
388
  }
389
389
  });
390
390
  });
391
+ var _ncuaScope = require("./layout/ncua-scope");
392
+ Object.keys(_ncuaScope).forEach(function (key) {
393
+ if (key === "default" || key === "__esModule") return;
394
+ if (key in exports && exports[key] === _ncuaScope[key]) return;
395
+ Object.defineProperty(exports, key, {
396
+ enumerable: true,
397
+ get: function () {
398
+ return _ncuaScope[key];
399
+ }
400
+ });
401
+ });
391
402
  var _pageTitle = require("./layout/page-title");
392
403
  Object.keys(_pageTitle).forEach(function (key) {
393
404
  if (key === "default" || key === "__esModule") return;
@@ -487,6 +498,17 @@ Object.keys(_notification).forEach(function (key) {
487
498
  }
488
499
  });
489
500
  });
501
+ var _postcodeSearchModal = require("./overlays/postcode-search-modal");
502
+ Object.keys(_postcodeSearchModal).forEach(function (key) {
503
+ if (key === "default" || key === "__esModule") return;
504
+ if (key in exports && exports[key] === _postcodeSearchModal[key]) return;
505
+ Object.defineProperty(exports, key, {
506
+ enumerable: true,
507
+ get: function () {
508
+ return _postcodeSearchModal[key];
509
+ }
510
+ });
511
+ });
490
512
  var _tooltip = require("./overlays/tooltip");
491
513
  Object.keys(_tooltip).forEach(function (key) {
492
514
  if (key === "default" || key === "__esModule") return;
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ 'use client';
3
+
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.NcuaScope = void 0;
8
+ var _jsxRuntime = require("react/jsx-runtime");
9
+ var _classnames = _interopRequireDefault(require("classnames"));
10
+ var _react = require("react");
11
+ var _scopedCss = require("../../../generated/scoped-css");
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ // 쑰상에 NcuaScope κ°€ 이미 있으면 μŠ€νƒ€μΌμ„ λ‹€μ‹œ 심지 μ•ŠλŠ”λ‹€ (쀑첩 λŒ€μ‘).
14
+ const NcuaStyleMountedContext = /*#__PURE__*/(0, _react.createContext)(false);
15
+ // React 19 λŠ” <style> 에 hrefΒ·precedence κ°€ ν•¨κ»˜ 있으면 <head> 둜 올리고 href 둜 쀑볡을
16
+ // μ œκ±°ν•œλ‹€. 18 μ—λŠ” κ·Έ κΈ°λŠ₯도, 두 prop 의 νƒ€μž… μ •μ˜λ„ μ—†μ–΄ Context 둜 μ€‘μ²©λ§Œ 막고
17
+ // νƒ€μž…μ€ μš°νšŒν•œλ‹€.
18
+ const STYLE_HOISTING_MIN_REACT_MAJOR = 19;
19
+ const DECIMAL_RADIX = 10;
20
+ const SUPPORTS_STYLE_HOISTING = Number.parseInt(_react.version, DECIMAL_RADIX) >= STYLE_HOISTING_MIN_REACT_MAJOR;
21
+ const STYLE_KEY = 'ncua-scoped';
22
+ const STYLE_HOISTING_PROPS = {
23
+ href: STYLE_KEY,
24
+ precedence: 'default'
25
+ };
26
+ // SSR 은 <style> 의 μžμ‹ ν…μŠ€νŠΈλ₯Ό HTML μ΄μŠ€μΌ€μ΄ν”„ν•˜μ§€λ§Œ(' -> &#x27;), λΈŒλΌμš°μ €λŠ” <style>
27
+ // μ•ˆμ„ raw text 둜 읽어 λ˜λŒλ¦¬μ§€ μ•ŠλŠ”λ‹€. 그러면 CSS κ°€ κΉ¨μ§€κ³  ν•˜μ΄λ“œλ ˆμ΄μ…˜λ„ λΆˆμΌμΉ˜ν•œλ‹€.
28
+ // innerHTML 둜 λ„£μœΌλ©΄ μ„œλ²„κ°€ 원문 κ·ΈλŒ€λ‘œ 내보낸닀.
29
+ const STYLE_CONTENT = {
30
+ __html: _scopedCss.NCUA_SCOPED_CSS
31
+ };
32
+ /**
33
+ * NCUA μŠ€νƒ€μΌμ„ 이 μ—˜λ¦¬λ¨ΌνŠΈ ν•˜μœ„λ‘œ ν•œμ •ν•˜λŠ” 경계.
34
+ *
35
+ * λ‹€λ₯Έ λ””μžμΈ μ‹œμŠ€ν…œμ„ μ „μ—­ μ μš©ν•œ μ‚¬μš©μ²˜μ—μ„œ NCUA μ»΄ν¬λ„ŒνŠΈλ₯Ό 이걸둜 감싼닀.
36
+ * μŠ€νƒ€μΌμ„ 직접 λ“€κ³  μžˆμœΌλ―€λ‘œ **CSS νŒŒμΌμ„ λ”°λ‘œ import ν•˜μ§€ μ•ŠλŠ”λ‹€.**
37
+ *
38
+ * ```tsx
39
+ * import { NcuaScope, Button } from '@ncds/ui-admin';
40
+ *
41
+ * <NcuaScope>
42
+ * <Button label="μ‹ μ²­ν•˜κΈ°" hierarchy="primary" size="md" />
43
+ * </NcuaScope>
44
+ * ```
45
+ *
46
+ * `document.body` 둜 portal λ˜λŠ” μ»΄ν¬λ„ŒνŠΈ(Modal Β· Tooltip Β· Dropdown Β· SelectBox Β·
47
+ * Notification)λŠ” 이 경계 밖에 λ†“μ΄μ§€λ§Œ, μŠ€μ½”ν”„ μŠ€νƒ€μΌμ‹œνŠΈκ°€ κ·Έ 루트 ν΄λž˜μŠ€λ“€μ„ ν•¨κ»˜
48
+ * μ§€μ •ν•˜λ―€λ‘œ 토큰을 λ°›λŠ”λ‹€ (`base/_scope.scss` 의 `$roots`). portal λͺ©μ μ§€λŠ” λ°”λ€Œμ§€
49
+ * μ•ŠμœΌλ―€λ‘œ μ–΄λ“œλ―Όμ—μ„œμ˜ κΈ°μ‘΄ λ™μž‘κ³Ό κ°™λ‹€.
50
+ *
51
+ * μ–΄λ“œλ―Όμ²˜λŸΌ `style.css` λ₯Ό μ „μ—­ μ μš©ν•˜λŠ” μ‚¬μš©μ²˜λŠ” 이 μ»΄ν¬λ„ŒνŠΈκ°€ ν•„μš” μ—†λ‹€.
52
+ *
53
+ * μ€‘μ²©ν•΄μ„œ 써도 μŠ€νƒ€μΌμ€ ν•œ 번만 λ“€μ–΄κ°„λ‹€. React 19 μ—μ„œλŠ” ν˜•μ œλ‘œ μ—¬λŸ¬ 개λ₯Ό 써도
54
+ * href κΈ°μ€€μœΌλ‘œ 쀑볡이 μ œκ±°λœλ‹€. React 18 μ—μ„œλŠ” ν˜•μ œλ§ˆλ‹€ `<style>` 이 ν•˜λ‚˜μ”© μƒκΈ°λ―€λ‘œ,
55
+ * μŠ€μ½”ν”„κ°€ μ—¬λŸ¬ 곳에 ν•„μš”ν•˜λ©΄ 곡톡 쑰상 ν•œ κ³³μ—μ„œ κ°μ‹ΈλŠ” 편이 λ‚«λ‹€.
56
+ */
57
+ const NcuaScope = exports.NcuaScope = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
58
+ let {
59
+ className,
60
+ children
61
+ } = _ref;
62
+ const styleAlreadyMounted = (0, _react.useContext)(NcuaStyleMountedContext);
63
+ const shouldRenderStyle = SUPPORTS_STYLE_HOISTING || !styleAlreadyMounted;
64
+ return (0, _jsxRuntime.jsxs)(NcuaStyleMountedContext.Provider, {
65
+ value: true,
66
+ children: [shouldRenderStyle && (SUPPORTS_STYLE_HOISTING ? (0, _jsxRuntime.jsx)("style", {
67
+ ...STYLE_HOISTING_PROPS,
68
+ dangerouslySetInnerHTML: STYLE_CONTENT
69
+ }) : (0, _jsxRuntime.jsx)("style", {
70
+ "data-ncua-scope": STYLE_KEY,
71
+ dangerouslySetInnerHTML: STYLE_CONTENT
72
+ })), (0, _jsxRuntime.jsx)("div", {
73
+ ref: ref,
74
+ className: (0, _classnames.default)('ncua-scope', className),
75
+ children: children
76
+ })]
77
+ });
78
+ });
79
+ NcuaScope.displayName = 'NcuaScope';
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _NcuaScope = require("./NcuaScope");
7
+ Object.keys(_NcuaScope).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _NcuaScope[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _NcuaScope[key];
14
+ }
15
+ });
16
+ });
@@ -26,7 +26,9 @@ const Pagination = _ref => {
26
26
  const [start, setStart] = (0, _react.useState)(1);
27
27
  const noPrev = breakPoint === 'mo' ? currentPage === 1 : start === 1;
28
28
  const noNext = breakPoint === 'mo' ? currentPage >= totalPage : start + pageCount - 1 >= totalPage;
29
- const showJumpPageButton = totalPage > pageCount;
29
+ // mo λŠ” CSS κ°€ νŽ˜μ΄μ§€ 번호 λͺ©λ‘κ³Ό first/last λ₯Ό 숨겨 prev/next 만 λ‚¨λŠ”λ‹€.
30
+ // pc κΈ°μ€€(totalPage > pageCount)을 κ·ΈλŒ€λ‘œ μ“°λ©΄ νŽ˜μ΄μ§€κ°€ 적을 λ•Œ 이동 μˆ˜λ‹¨μ΄ ν•˜λ‚˜λ„ μ—†λ‹€.
31
+ const showJumpPageButton = breakPoint === 'mo' ? totalPage > 1 : totalPage > pageCount;
30
32
  const handleClickButton = pageNum => {
31
33
  if ((0, _lodashEs.isFunction)(onPageChange)) {
32
34
  onPageChange(pageNum);
@@ -15,6 +15,12 @@ const CURRENT_PAGE = 91; // 100νŽ˜μ΄μ§€ κΈ°μ€€ λ§ˆμ§€λ§‰ κ·Έλ£Ή(91~100)을 보
15
15
  const GROUP_START_100_PAGES = 91; // currentPage=91 일 λ•Œμ˜ κ·Έλ£Ή μ‹œμž‘
16
16
  const GROUP_START_50_PAGES = 41; // totalPage=50 으둜 μ€„μ—ˆμ„ λ•Œμ˜ λ§ˆμ§€λ§‰ κ·Έλ£Ή μ‹œμž‘
17
17
  const LAST_PAGE_50 = 50;
18
+ /** νŽ˜μ΄μ§€ κ·Έλ£Ή 크기(10) μ΄ν•˜λ‘œ λ‚˜λ‰˜λŠ” 건수 β€” 3νŽ˜μ΄μ§€ */
19
+ const TOTAL_COUNT_3_PAGES = 30;
20
+ /** TOTAL_COUNT_3_PAGES κΈ°μ€€ 총 νŽ˜μ΄μ§€ 수 = λ§ˆμ§€λ§‰ νŽ˜μ΄μ§€ 번호 */
21
+ const LAST_PAGE_3 = 3;
22
+ /** νŽ˜μ΄μ§€κ°€ ν•˜λ‚˜λΏμΈ 건수 */
23
+ const TOTAL_COUNT_1_PAGE = 8;
18
24
  let root = null;
19
25
  let container = null;
20
26
  function render(props) {
@@ -37,6 +43,8 @@ function render(props) {
37
43
  container = null;
38
44
  });
39
45
  const pageNums = el => Array.from(el.querySelectorAll('.ncua-pagination__page-num')).map(b => Number(b.textContent));
46
+ const prevOf = el => el.querySelector('.ncua-pagination__before');
47
+ const nextOf = el => el.querySelector('.ncua-pagination__next');
40
48
  (0, _vitest.describe)('#332 Pagination β€” totalPage μΆ•μ†Œ μ‹œ start 보정', () => {
41
49
  (0, _vitest.it)('totalPage κ°€ 쀄면 start λ₯Ό λ§ˆμ§€λ§‰ 그룹으둜 λ³΄μ •ν•˜κ³  λ²”μœ„ λ°– νŽ˜μ΄μ§€ λ²„νŠΌμ„ ν‘œμ‹œν•˜μ§€ μ•ŠλŠ”λ‹€', () => {
42
50
  // 1) 100 νŽ˜μ΄μ§€μ—μ„œ 91 νŽ˜μ΄μ§€ λ³΄λŠ” 쀑 β†’ 91~100 κ·Έλ£Ή ν‘œμ‹œ
@@ -59,4 +67,70 @@ const pageNums = el => Array.from(el.querySelectorAll('.ncua-pagination__page-nu
59
67
  (0, _vitest.expect)(nums[0]).toBe(GROUP_START_50_PAGES);
60
68
  (0, _vitest.expect)(Math.max(...nums)).toBeLessThanOrEqual(LAST_PAGE_50);
61
69
  });
70
+ });
71
+ (0, _vitest.describe)('Pagination β€” mo λͺ¨λ“œ 이전/λ‹€μŒ λ²„νŠΌ λ…ΈμΆœ', () => {
72
+ (0, _vitest.it)('νŽ˜μ΄μ§€κ°€ κ·Έλ£Ή 크기 μ΄ν•˜μ—¬λ„ mo μ—μ„œλŠ” μ΄μ „Β·λ‹€μŒ λ²„νŠΌμ΄ λ…ΈμΆœλœλ‹€', () => {
73
+ // Given/When: 3νŽ˜μ΄μ§€(κ·Έλ£Ή 크기 10 μ΄ν•˜) λΆ„λŸ‰μ„ mo 둜 λ Œλ”ν•˜λ©΄
74
+ const el = render({
75
+ totalCount: TOTAL_COUNT_3_PAGES,
76
+ itemCountPerPage: ITEM_COUNT_PER_PAGE,
77
+ pageCount: PAGE_GROUP_SIZE,
78
+ currentPage: 1,
79
+ breakPoint: 'mo'
80
+ });
81
+ // Then: mo λŠ” νŽ˜μ΄μ§€ 번호 λͺ©λ‘μ΄ CSS 둜 μˆ¨κ²¨μ§€λ―€λ‘œ μ΄μ „Β·λ‹€μŒ λ²„νŠΌμ΄ μžˆμ–΄μ•Ό 이동할 수 μžˆλ‹€
82
+ (0, _vitest.expect)(prevOf(el)).not.toBeNull();
83
+ (0, _vitest.expect)(nextOf(el)).not.toBeNull();
84
+ });
85
+ (0, _vitest.it)('첫 νŽ˜μ΄μ§€μ—μ„œλŠ” 이전 λ²„νŠΌμ΄, λ§ˆμ§€λ§‰ νŽ˜μ΄μ§€μ—μ„œλŠ” λ‹€μŒ λ²„νŠΌμ΄ λΉ„ν™œμ„±μ΄λ‹€', () => {
86
+ // Given/When: 3νŽ˜μ΄μ§€ 쀑 첫 νŽ˜μ΄μ§€λ₯Ό mo 둜 λ Œλ”ν•˜λ©΄
87
+ const first = render({
88
+ totalCount: TOTAL_COUNT_3_PAGES,
89
+ itemCountPerPage: ITEM_COUNT_PER_PAGE,
90
+ pageCount: PAGE_GROUP_SIZE,
91
+ currentPage: 1,
92
+ breakPoint: 'mo'
93
+ });
94
+ // Then: μ΄μ „λ§Œ λ§‰νžˆκ³  λ‹€μŒμ€ λˆ„λ₯Ό 수 μžˆλ‹€
95
+ (0, _vitest.expect)(prevOf(first)?.disabled).toBe(true);
96
+ (0, _vitest.expect)(nextOf(first)?.disabled).toBe(false);
97
+ // When: λ§ˆμ§€λ§‰ νŽ˜μ΄μ§€λ‘œ μ΄λ™ν•˜λ©΄
98
+ const last = render({
99
+ totalCount: TOTAL_COUNT_3_PAGES,
100
+ itemCountPerPage: ITEM_COUNT_PER_PAGE,
101
+ pageCount: PAGE_GROUP_SIZE,
102
+ currentPage: LAST_PAGE_3,
103
+ breakPoint: 'mo'
104
+ });
105
+ // Then: λ°˜λŒ€λ‘œ λ‹€μŒμ΄ λ§‰νžŒλ‹€
106
+ (0, _vitest.expect)(prevOf(last)?.disabled).toBe(false);
107
+ (0, _vitest.expect)(nextOf(last)?.disabled).toBe(true);
108
+ });
109
+ (0, _vitest.it)('νŽ˜μ΄μ§€κ°€ ν•˜λ‚˜λΏμ΄λ©΄ mo μ—μ„œλ„ μ΄μ „Β·λ‹€μŒ λ²„νŠΌμ„ 내보내지 μ•ŠλŠ”λ‹€', () => {
110
+ // Given/When: 1νŽ˜μ΄μ§€ λΆ„λŸ‰μ„ mo 둜 λ Œλ”ν•˜λ©΄
111
+ const el = render({
112
+ totalCount: TOTAL_COUNT_1_PAGE,
113
+ itemCountPerPage: ITEM_COUNT_PER_PAGE,
114
+ pageCount: PAGE_GROUP_SIZE,
115
+ currentPage: 1,
116
+ breakPoint: 'mo'
117
+ });
118
+ // Then: 이동할 곳이 μ—†μœΌλ―€λ‘œ λ²„νŠΌλ„ μ—†λ‹€
119
+ (0, _vitest.expect)(prevOf(el)).toBeNull();
120
+ (0, _vitest.expect)(nextOf(el)).toBeNull();
121
+ });
122
+ (0, _vitest.it)('pc λŠ” κΈ°μ‘΄λŒ€λ‘œ νŽ˜μ΄μ§€ 그룹을 λ„˜κΈΈ λ•Œλ§Œ 점프 λ²„νŠΌμ„ λ…ΈμΆœν•œλ‹€', () => {
123
+ // Given/When: 3νŽ˜μ΄μ§€ λΆ„λŸ‰μ„ pc 둜 λ Œλ”ν•˜λ©΄
124
+ const el = render({
125
+ totalCount: TOTAL_COUNT_3_PAGES,
126
+ itemCountPerPage: ITEM_COUNT_PER_PAGE,
127
+ pageCount: PAGE_GROUP_SIZE,
128
+ currentPage: 1,
129
+ breakPoint: 'pc'
130
+ });
131
+ // Then: νŽ˜μ΄μ§€ 번호둜 직접 μ΄λ™ν•˜λ―€λ‘œ 점프 λ²„νŠΌμ€ λ‚˜μ˜€μ§€ μ•ŠλŠ”λ‹€
132
+ (0, _vitest.expect)(prevOf(el)).toBeNull();
133
+ (0, _vitest.expect)(nextOf(el)).toBeNull();
134
+ (0, _vitest.expect)(pageNums(el)).toHaveLength(LAST_PAGE_3);
135
+ });
62
136
  });
@@ -9,6 +9,7 @@ var _uiAdminIcon = require("@ncds/ui-admin-icon");
9
9
  var _classnames = _interopRequireDefault(require("classnames"));
10
10
  var _react = require("react");
11
11
  var _color = require("../../../../constant/color");
12
+ var _notification = require("../../../../constant/notification");
12
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
14
  const iconMap = {
14
15
  neutral: _uiAdminIcon.MessageChatSquare,
@@ -35,6 +36,7 @@ const FullWidthNotification = exports.FullWidthNotification = /*#__PURE__*/(0, _
35
36
  autoClose = 0,
36
37
  supportTextLink,
37
38
  onHidePermanently,
39
+ hidePermanentlyLabel = _notification.HIDE_PERMANENTLY_LABEL.fullWidth,
38
40
  ...rest
39
41
  } = _ref;
40
42
  const [shouldRemove, setShouldRemove] = (0, _react.useState)(false);
@@ -116,7 +118,7 @@ const FullWidthNotification = exports.FullWidthNotification = /*#__PURE__*/(0, _
116
118
  type: "button",
117
119
  className: (0, _classnames.default)('ncua-notification__action-button', 'ncua-notification__action-button--text', 'ncua-full-width-notification__link'),
118
120
  onClick: onHidePermanently,
119
- children: "\uB2E4\uC2DC\uBCF4\uC9C0 \uC54A\uAE30"
121
+ children: hidePermanentlyLabel
120
122
  }), onClose && (0, _jsxRuntime.jsx)("button", {
121
123
  type: "button",
122
124
  className: "ncua-full-width-notification__close-button",
@@ -9,8 +9,7 @@ var _uiAdminIcon = require("@ncds/ui-admin-icon");
9
9
  var _classnames = _interopRequireDefault(require("classnames"));
10
10
  var _react = require("react");
11
11
  var _color = require("../../../../constant/color");
12
- var _button = require("../../action/button");
13
- var _FeaturedIcon = require("../../image-and-icons/featured-icon/FeaturedIcon");
12
+ var _MessageNotificationParts = require("./MessageNotificationParts");
14
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
14
  const iconMap = {
16
15
  neutral: _uiAdminIcon.Pin02,
@@ -34,18 +33,11 @@ const MessageNotification = exports.MessageNotification = /*#__PURE__*/(0, _reac
34
33
  className,
35
34
  actions,
36
35
  onHidePermanently,
36
+ hidePermanentlyLabel,
37
37
  ...rest
38
38
  } = _ref;
39
39
  // message νƒ€μž…μ€ neutral, error, warning, success 4κ°€μ§€ μƒ‰μƒλ§Œ 지원
40
40
  const validColor = color === 'info' ? 'neutral' : color;
41
- const iconColor = validColor;
42
- const featuredIconProps = {
43
- icon: Icon || iconMap[validColor] || _uiAdminIcon.Pin02,
44
- size: 'lg',
45
- color: iconColor,
46
- theme: 'light-circle'
47
- };
48
- const closeIconColor = _color.COLOR[iconColorMap[validColor] || 'gray700'];
49
41
  return (0, _jsxRuntime.jsx)("div", {
50
42
  ref: ref,
51
43
  className: (0, _classnames.default)('ncua-message-notification', `ncua-message-notification--${validColor}`, className),
@@ -55,50 +47,18 @@ const MessageNotification = exports.MessageNotification = /*#__PURE__*/(0, _reac
55
47
  className: "ncua-message-notification__container",
56
48
  children: (0, _jsxRuntime.jsxs)("div", {
57
49
  className: "ncua-message-notification__content",
58
- children: [(0, _jsxRuntime.jsxs)("div", {
59
- className: "ncua-message-notification__content-wrapper",
60
- children: [iconMap[validColor] && (0, _jsxRuntime.jsx)(_FeaturedIcon.FeaturedIcon, {
61
- ...featuredIconProps,
62
- className: "ncua-message-notification__icon"
63
- }), (0, _jsxRuntime.jsxs)("div", {
64
- className: "ncua-message-notification__text-container",
65
- children: [(0, _jsxRuntime.jsx)("span", {
66
- className: "ncua-message-notification__title",
67
- children: title
68
- }), supportingText && (0, _jsxRuntime.jsx)("span", {
69
- className: "ncua-message-notification__supporting-text",
70
- children: supportingText
71
- })]
72
- })]
73
- }), (0, _jsxRuntime.jsx)("div", {
74
- className: "ncua-message-notification__actions-container",
75
- children: actions && (0, _jsxRuntime.jsx)("div", {
76
- className: "ncua-message-notification__actions",
77
- children: actions.map(action => (0, _jsxRuntime.jsx)(_button.Button, {
78
- size: "xs",
79
- hierarchy: action.hierarchy || 'text',
80
- label: action.label,
81
- onClick: action?.onClick
82
- }, `${action.label}-${action.hierarchy}`))
83
- })
84
- }), (0, _jsxRuntime.jsxs)("div", {
85
- className: "ncua-message-notification__footer-container",
86
- children: [onHidePermanently && (0, _jsxRuntime.jsx)("button", {
87
- type: "button",
88
- className: (0, _classnames.default)('ncua-notification__action-button', 'ncua-notification__action-button--link', 'ncua-message-notification__hide-link'),
89
- onClick: onHidePermanently,
90
- children: "\uB2E4\uC2DC \uBCF4\uC9C0 \uC54A\uAE30"
91
- }), onClose && (0, _jsxRuntime.jsx)("button", {
92
- type: "button",
93
- className: "ncua-message-notification__close-button",
94
- onClick: onClose,
95
- "aria-label": "\uC54C\uB9BC \uB2EB\uAE30",
96
- children: (0, _jsxRuntime.jsx)(_uiAdminIcon.XClose, {
97
- width: 20,
98
- height: 20,
99
- color: closeIconColor
100
- })
101
- })]
50
+ children: [(0, _jsxRuntime.jsx)(_MessageNotificationParts.MessageNotificationContent, {
51
+ title: title,
52
+ supportingText: supportingText,
53
+ icon: Icon || iconMap[validColor],
54
+ iconColor: validColor,
55
+ showIcon: Boolean(iconMap[validColor])
56
+ }), (0, _jsxRuntime.jsx)(_MessageNotificationParts.MessageNotificationActions, {
57
+ actions: actions,
58
+ onClose: onClose,
59
+ onHidePermanently: onHidePermanently,
60
+ hidePermanentlyLabel: hidePermanentlyLabel,
61
+ closeIconColor: _color.COLOR[iconColorMap[validColor] || 'gray700']
102
62
  })]
103
63
  })
104
64
  })