@hortiview/shared-components 0.0.4723 → 0.0.4724

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 (58) hide show
  1. package/dist/_getTag-DyrzUAbj.js +494 -0
  2. package/dist/components/BaseView/BaseView.js +43 -297
  3. package/dist/components/BasicHeading/BasicHeading.js +24 -25
  4. package/dist/components/BasicHeading/BasicHeading.test.js +4 -4
  5. package/dist/components/BlockView/BlockView.js +14 -14
  6. package/dist/components/DeleteModal/DeleteModal.js +49 -4687
  7. package/dist/components/Disclaimer/Disclaimer.js +8 -10
  8. package/dist/components/EmptyView/EmptyView.js +8 -247
  9. package/dist/components/HashTabView/HashTabView.js +52 -1838
  10. package/dist/components/HeaderFilter/HeaderFilter.js +18 -7595
  11. package/dist/components/Iconify/Iconify.js +1 -1
  12. package/dist/components/ListArea/ListArea.js +316 -261
  13. package/dist/components/ListArea/ListArea.test.js +1 -1
  14. package/dist/components/ListArea/ListAreaService.js +34 -35
  15. package/dist/components/SearchBar/SearchBar.js +21 -2043
  16. package/package.json +1 -1
  17. package/dist/BlockView.module-ypKp14Lt.cjs +0 -1
  18. package/dist/HashTabView.module-B20c3S70.cjs +0 -1
  19. package/dist/HeaderFilter.module-DSCJz6-s.cjs +0 -1
  20. package/dist/_commonjsHelpers-DwTZ_eVU.cjs +0 -1
  21. package/dist/_getTag-DNUtgXkb.js +0 -136
  22. package/dist/_getTag-DSIzMwlx.cjs +0 -1
  23. package/dist/_stringToPath-B-GSTJ2e.cjs +0 -1
  24. package/dist/_stringToPath-BfzwTbL6.js +0 -54
  25. package/dist/baseView.module--VUY4h_X.cjs +0 -1
  26. package/dist/basicHeading.module-BbcVMp42.cjs +0 -1
  27. package/dist/component-DJvMx3oL.cjs +0 -148
  28. package/dist/component-Rx4bNsGO.js +0 -680
  29. package/dist/disclaimer.module-BfrBh-Rf.cjs +0 -1
  30. package/dist/index.es-80RhGkCD.cjs +0 -1
  31. package/dist/index.es-Ba9oZK_n.js +0 -769
  32. package/dist/index.es-C1ojb4Lq.js +0 -106
  33. package/dist/index.es-CEydmFbW.cjs +0 -23
  34. package/dist/index.es-CKdjg72r.cjs +0 -64
  35. package/dist/index.es-CNBieliG.js +0 -151
  36. package/dist/index.es-CPRODq-I.cjs +0 -127
  37. package/dist/index.es-CQ3ep412.js +0 -305
  38. package/dist/index.es-CSD_u-fK.cjs +0 -1
  39. package/dist/index.es-CVCp4d0C.js +0 -45
  40. package/dist/index.es-Cct4Uapb.js +0 -1776
  41. package/dist/index.es-Cj9DW-2T.js +0 -430
  42. package/dist/index.es-Cm4X20_S.js +0 -673
  43. package/dist/index.es-Cqx46S1V.cjs +0 -540
  44. package/dist/index.es-DiO-sp-V.cjs +0 -1
  45. package/dist/index.es-DyXn5zZ8.cjs +0 -1
  46. package/dist/index.es-InSNsV4f.js +0 -1067
  47. package/dist/index.es-J3ub0jmR.cjs +0 -1
  48. package/dist/index.es-L0ZCcbUf.js +0 -4939
  49. package/dist/index.es-gvcK6-6t.cjs +0 -1
  50. package/dist/listArea.module-CMO-yRdf.cjs +0 -1
  51. package/dist/magic-string.es-EQkD18No.cjs +0 -10
  52. package/dist/react.esm-CMNZXU0t.cjs +0 -93
  53. package/dist/searchBar.module-CFi8D8zn.cjs +0 -1
  54. package/dist/tslib.es6-CIXEwqhg.js +0 -72
  55. package/dist/tslib.es6-D1TYK0An.cjs +0 -1
  56. package/dist/useBreakpoint-PUopk3AO.cjs +0 -1
  57. package/dist/verticalDivider.module-Ciw9Fnt1.cjs +0 -1
  58. package/dist/vi.JYQecGiw-M1q0RI3O.cjs +0 -512
@@ -1,769 +0,0 @@
1
- import { P as n, l as te, m as K, c as _, _ as N, u as ne, n as oe, e as re } from "./index.es-Cct4Uapb.js";
2
- import c, { forwardRef as L, useState as k, useRef as h, useImperativeHandle as P, useEffect as y, useMemo as $, useCallback as T, Fragment as U } from "react";
3
- import se from "react-dom";
4
- import { c as ae } from "./index.es-InSNsV4f.js";
5
- import { _ as A, a as O } from "./tslib.es6-CIXEwqhg.js";
6
- import { a as j, b as G, e as ie } from "./component-Rx4bNsGO.js";
7
- /**
8
- * @license
9
- * Copyright 2016 Google Inc.
10
- *
11
- * Permission is hereby granted, free of charge, to any person obtaining a copy
12
- * of this software and associated documentation files (the "Software"), to deal
13
- * in the Software without restriction, including without limitation the rights
14
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
- * copies of the Software, and to permit persons to whom the Software is
16
- * furnished to do so, subject to the following conditions:
17
- *
18
- * The above copyright notice and this permission notice shall be included in
19
- * all copies or substantial portions of the Software.
20
- *
21
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27
- * THE SOFTWARE.
28
- */
29
- var le = {
30
- LABEL_FLOAT_ABOVE: "mdc-floating-label--float-above",
31
- LABEL_REQUIRED: "mdc-floating-label--required",
32
- LABEL_SHAKE: "mdc-floating-label--shake",
33
- ROOT: "mdc-floating-label"
34
- };
35
- /**
36
- * @license
37
- * Copyright 2016 Google Inc.
38
- *
39
- * Permission is hereby granted, free of charge, to any person obtaining a copy
40
- * of this software and associated documentation files (the "Software"), to deal
41
- * in the Software without restriction, including without limitation the rights
42
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
43
- * copies of the Software, and to permit persons to whom the Software is
44
- * furnished to do so, subject to the following conditions:
45
- *
46
- * The above copyright notice and this permission notice shall be included in
47
- * all copies or substantial portions of the Software.
48
- *
49
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
50
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
51
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
52
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
53
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
54
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
55
- * THE SOFTWARE.
56
- */
57
- var Q = (
58
- /** @class */
59
- function(a) {
60
- A(t, a);
61
- function t(e) {
62
- var o = a.call(this, O(O({}, t.defaultAdapter), e)) || this;
63
- return o.shakeAnimationEndHandler_ = function() {
64
- return o.handleShakeAnimationEnd_();
65
- }, o;
66
- }
67
- return Object.defineProperty(t, "cssClasses", {
68
- get: function() {
69
- return le;
70
- },
71
- enumerable: !1,
72
- configurable: !0
73
- }), Object.defineProperty(t, "defaultAdapter", {
74
- /**
75
- * See {@link MDCFloatingLabelAdapter} for typing information on parameters and return types.
76
- */
77
- get: function() {
78
- return {
79
- addClass: function() {
80
- },
81
- removeClass: function() {
82
- },
83
- getWidth: function() {
84
- return 0;
85
- },
86
- registerInteractionHandler: function() {
87
- },
88
- deregisterInteractionHandler: function() {
89
- }
90
- };
91
- },
92
- enumerable: !1,
93
- configurable: !0
94
- }), t.prototype.init = function() {
95
- this.adapter.registerInteractionHandler("animationend", this.shakeAnimationEndHandler_);
96
- }, t.prototype.destroy = function() {
97
- this.adapter.deregisterInteractionHandler("animationend", this.shakeAnimationEndHandler_);
98
- }, t.prototype.getWidth = function() {
99
- return this.adapter.getWidth();
100
- }, t.prototype.shake = function(e) {
101
- var o = t.cssClasses.LABEL_SHAKE;
102
- e ? this.adapter.addClass(o) : this.adapter.removeClass(o);
103
- }, t.prototype.float = function(e) {
104
- var o = t.cssClasses, r = o.LABEL_FLOAT_ABOVE, s = o.LABEL_SHAKE;
105
- e ? this.adapter.addClass(r) : (this.adapter.removeClass(r), this.adapter.removeClass(s));
106
- }, t.prototype.setRequired = function(e) {
107
- var o = t.cssClasses.LABEL_REQUIRED;
108
- e ? this.adapter.addClass(o) : this.adapter.removeClass(o);
109
- }, t.prototype.handleShakeAnimationEnd_ = function() {
110
- var e = t.cssClasses.LABEL_SHAKE;
111
- this.adapter.removeClass(e);
112
- }, t;
113
- }(j)
114
- );
115
- /**
116
- * @license
117
- * Copyright 2016 Google Inc.
118
- *
119
- * Permission is hereby granted, free of charge, to any person obtaining a copy
120
- * of this software and associated documentation files (the "Software"), to deal
121
- * in the Software without restriction, including without limitation the rights
122
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
123
- * copies of the Software, and to permit persons to whom the Software is
124
- * furnished to do so, subject to the following conditions:
125
- *
126
- * The above copyright notice and this permission notice shall be included in
127
- * all copies or substantial portions of the Software.
128
- *
129
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
130
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
131
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
132
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
133
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
134
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
135
- * THE SOFTWARE.
136
- */
137
- var ce = (
138
- /** @class */
139
- function(a) {
140
- A(t, a);
141
- function t() {
142
- return a !== null && a.apply(this, arguments) || this;
143
- }
144
- return t.attachTo = function(e) {
145
- return new t(e);
146
- }, t.prototype.shake = function(e) {
147
- this.foundation.shake(e);
148
- }, t.prototype.float = function(e) {
149
- this.foundation.float(e);
150
- }, t.prototype.setRequired = function(e) {
151
- this.foundation.setRequired(e);
152
- }, t.prototype.getWidth = function() {
153
- return this.foundation.getWidth();
154
- }, t.prototype.getDefaultFoundation = function() {
155
- var e = this, o = {
156
- addClass: function(r) {
157
- return e.root.classList.add(r);
158
- },
159
- removeClass: function(r) {
160
- return e.root.classList.remove(r);
161
- },
162
- getWidth: function() {
163
- return ie(e.root);
164
- },
165
- registerInteractionHandler: function(r, s) {
166
- return e.listen(r, s);
167
- },
168
- deregisterInteractionHandler: function(r, s) {
169
- return e.unlisten(r, s);
170
- }
171
- };
172
- return new Q(o);
173
- }, t;
174
- }(G)
175
- );
176
- /**
177
- * @license
178
- * Copyright 2018 Google Inc.
179
- *
180
- * Permission is hereby granted, free of charge, to any person obtaining a copy
181
- * of this software and associated documentation files (the "Software"), to deal
182
- * in the Software without restriction, including without limitation the rights
183
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
184
- * copies of the Software, and to permit persons to whom the Software is
185
- * furnished to do so, subject to the following conditions:
186
- *
187
- * The above copyright notice and this permission notice shall be included in
188
- * all copies or substantial portions of the Software.
189
- *
190
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
191
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
192
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
193
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
194
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
195
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
196
- * THE SOFTWARE.
197
- */
198
- var V = {
199
- NOTCH_ELEMENT_SELECTOR: ".mdc-notched-outline__notch"
200
- }, q = {
201
- // This should stay in sync with $mdc-notched-outline-padding * 2.
202
- NOTCH_ELEMENT_PADDING: 8
203
- }, H = {
204
- NO_LABEL: "mdc-notched-outline--no-label",
205
- OUTLINE_NOTCHED: "mdc-notched-outline--notched",
206
- OUTLINE_UPGRADED: "mdc-notched-outline--upgraded"
207
- };
208
- /**
209
- * @license
210
- * Copyright 2017 Google Inc.
211
- *
212
- * Permission is hereby granted, free of charge, to any person obtaining a copy
213
- * of this software and associated documentation files (the "Software"), to deal
214
- * in the Software without restriction, including without limitation the rights
215
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
216
- * copies of the Software, and to permit persons to whom the Software is
217
- * furnished to do so, subject to the following conditions:
218
- *
219
- * The above copyright notice and this permission notice shall be included in
220
- * all copies or substantial portions of the Software.
221
- *
222
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
223
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
224
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
225
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
226
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
227
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
228
- * THE SOFTWARE.
229
- */
230
- var de = (
231
- /** @class */
232
- function(a) {
233
- A(t, a);
234
- function t(e) {
235
- return a.call(this, O(O({}, t.defaultAdapter), e)) || this;
236
- }
237
- return Object.defineProperty(t, "strings", {
238
- get: function() {
239
- return V;
240
- },
241
- enumerable: !1,
242
- configurable: !0
243
- }), Object.defineProperty(t, "cssClasses", {
244
- get: function() {
245
- return H;
246
- },
247
- enumerable: !1,
248
- configurable: !0
249
- }), Object.defineProperty(t, "numbers", {
250
- get: function() {
251
- return q;
252
- },
253
- enumerable: !1,
254
- configurable: !0
255
- }), Object.defineProperty(t, "defaultAdapter", {
256
- /**
257
- * See {@link MDCNotchedOutlineAdapter} for typing information on parameters and return types.
258
- */
259
- get: function() {
260
- return {
261
- addClass: function() {
262
- },
263
- removeClass: function() {
264
- },
265
- setNotchWidthProperty: function() {
266
- },
267
- removeNotchWidthProperty: function() {
268
- }
269
- };
270
- },
271
- enumerable: !1,
272
- configurable: !0
273
- }), t.prototype.notch = function(e) {
274
- var o = t.cssClasses.OUTLINE_NOTCHED;
275
- e > 0 && (e += q.NOTCH_ELEMENT_PADDING), this.adapter.setNotchWidthProperty(e), this.adapter.addClass(o);
276
- }, t.prototype.closeNotch = function() {
277
- var e = t.cssClasses.OUTLINE_NOTCHED;
278
- this.adapter.removeClass(e), this.adapter.removeNotchWidthProperty();
279
- }, t;
280
- }(j)
281
- );
282
- /**
283
- * @license
284
- * Copyright 2017 Google Inc.
285
- *
286
- * Permission is hereby granted, free of charge, to any person obtaining a copy
287
- * of this software and associated documentation files (the "Software"), to deal
288
- * in the Software without restriction, including without limitation the rights
289
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
290
- * copies of the Software, and to permit persons to whom the Software is
291
- * furnished to do so, subject to the following conditions:
292
- *
293
- * The above copyright notice and this permission notice shall be included in
294
- * all copies or substantial portions of the Software.
295
- *
296
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
297
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
298
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
299
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
300
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
301
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
302
- * THE SOFTWARE.
303
- */
304
- var ue = (
305
- /** @class */
306
- function(a) {
307
- A(t, a);
308
- function t() {
309
- return a !== null && a.apply(this, arguments) || this;
310
- }
311
- return t.attachTo = function(e) {
312
- return new t(e);
313
- }, t.prototype.initialSyncWithDOM = function() {
314
- this.notchElement_ = this.root.querySelector(V.NOTCH_ELEMENT_SELECTOR);
315
- var e = this.root.querySelector("." + Q.cssClasses.ROOT);
316
- e ? (e.style.transitionDuration = "0s", this.root.classList.add(H.OUTLINE_UPGRADED), requestAnimationFrame(function() {
317
- e.style.transitionDuration = "";
318
- })) : this.root.classList.add(H.NO_LABEL);
319
- }, t.prototype.notch = function(e) {
320
- this.foundation.notch(e);
321
- }, t.prototype.closeNotch = function() {
322
- this.foundation.closeNotch();
323
- }, t.prototype.getDefaultFoundation = function() {
324
- var e = this, o = {
325
- addClass: function(r) {
326
- return e.root.classList.add(r);
327
- },
328
- removeClass: function(r) {
329
- return e.root.classList.remove(r);
330
- },
331
- setNotchWidthProperty: function(r) {
332
- return e.notchElement_.style.setProperty("width", r + "px");
333
- },
334
- removeNotchWidthProperty: function() {
335
- return e.notchElement_.style.removeProperty("width");
336
- }
337
- };
338
- return new de(o);
339
- }, t;
340
- }(G)
341
- );
342
- const pe = {
343
- /**
344
- * Content to be rendered inside the portal.
345
- *
346
- * Defaults to **null**.
347
- */
348
- children: n.node,
349
- /**
350
- * Disables the portal to rendering children in the natural flow of the DOM.
351
- *
352
- * Defaults to **false**.
353
- */
354
- disabled: n.bool,
355
- /**
356
- * The DOM element the children will render in. If a string is sent it should be a valid DOM query selector. If one is not sent, Portal will default to `document.body`.
357
- *
358
- * Defaults to **'document.body'**.
359
- */
360
- portalContainer: n.oneOfType([n.string, n.node])
361
- }, fe = {
362
- children: null,
363
- disabled: !1,
364
- portalContainer: "document.body"
365
- }, D = /* @__PURE__ */ L((a, t) => {
366
- const [e, o] = k(document.body), {
367
- children: r,
368
- container: s,
369
- disabled: p
370
- } = a, i = h();
371
- return P(t, () => i.current, []), y(() => {
372
- if (typeof s == "string")
373
- if (s === "document.body")
374
- o(document.body);
375
- else {
376
- const d = te(s);
377
- o(d || document.body);
378
- }
379
- else
380
- o(s || document.body);
381
- }, [s]), // eslint-disable-next-line react/jsx-no-useless-fragment
382
- /* @__PURE__ */ c.createElement(c.Fragment, null, p ? r : /* @__PURE__ */ se.createPortal(r, e));
383
- });
384
- D.displayName = "Portal";
385
- D.propTypes = pe;
386
- D.defaultProps = fe;
387
- var me = /* @__PURE__ */ c.memo(D);
388
- const he = {
389
- /**
390
- * Accepts any valid markup. This will be rendered before any value set with the `text` prop. For most use-cases use `text`.
391
- *
392
- * Defaults to **undefined**.
393
- */
394
- children: n.node.isRequired,
395
- /**
396
- * The css class name to be passed through to the component markup.
397
- *
398
- * Defaults to **undefined**.
399
- */
400
- className: n.string,
401
- /**
402
- * Container display type, inline or block.
403
- *
404
- * Defaults to **'inline'**.
405
- */
406
- containerType: n.oneOf(["inline", "block"]),
407
- /**
408
- * Whether or not the tooltip is hoisted to render outside of the parent element. Useful for when the tooltip needs to render in a parent with `overflow: hidden` ie. a table cell.
409
- *
410
- * Defaults to **false**.
411
- */
412
- hoisted: n.bool,
413
- /**
414
- * Randomly generated id. May be overwritten.
415
- *
416
- * Defaults to **undefined**.
417
- */
418
- id: n.string,
419
- /**
420
- * Fired when the trigger is interacted with.
421
- *
422
- * Defaults to **null**.
423
- */
424
- onClick: n.func,
425
- /**
426
- * The DOM element the children will render in. If a string is sent it should be a valid DOM query selector. If one is not sent, Portal will default to `document.body`.
427
- *
428
- * Defaults to **'document.body'**.
429
- */
430
- portalContainer: n.oneOfType([n.string, n.node]),
431
- /**
432
- * Position of tooltip. Options include: 'top', 'left', 'right', and 'bottom'(default).
433
- *
434
- * Defaults to **'bottom'**.
435
- */
436
- position: n.oneOf(["bottom", "top", "left", "right"]),
437
- /**
438
- * string
439
- *
440
- * Defaults to **null**.
441
- */
442
- text: n.oneOfType([n.string, n.func, n.node]).isRequired,
443
- /**
444
- * Custom properties to apply to the hovering element.
445
- *
446
- * Defaults to **null**.
447
- */
448
- tooltipProps: n.object,
449
- /**
450
- * Custom properties to apply to the trigger element.
451
- *
452
- * Defaults to **null**.
453
- */
454
- triggerProps: n.object
455
- }, ye = {
456
- children: void 0,
457
- className: void 0,
458
- containerType: "inline",
459
- hoisted: !1,
460
- id: void 0,
461
- portalContainer: "document.body",
462
- position: "bottom",
463
- text: null,
464
- tooltipProps: null,
465
- triggerProps: null
466
- }, Ee = {
467
- /**
468
- * The css class name to be passed through to the component markup.
469
- *
470
- * Defaults to **undefined**.
471
- */
472
- className: n.string,
473
- /**
474
- * Whether or not the tooltip is hoisted to render outside of the parent element. Useful for when the tooltip needs to render in a parent with `overflow: hidden` ie. a table cell.
475
- *
476
- * Defaults to **false**.
477
- */
478
- hoisted: n.bool,
479
- /**
480
- * Randomly generated id. May be overwritten.
481
- *
482
- * Defaults to **undefined**.
483
- */
484
- id: n.string,
485
- /**
486
- * The DOM element the children will render in. If a string is sent it should be a valid DOM query selector. If one is not sent, Portal will default to `document.body`.
487
- *
488
- * Defaults to **'document.body'**.
489
- */
490
- portalContainer: n.oneOfType([n.string, n.node]),
491
- /**
492
- * The text to be rendered inside of the Tooltip.
493
- *
494
- * Defaults to **null**.
495
- */
496
- text: n.oneOfType([n.string, n.func, n.node]).isRequired
497
- }, be = {
498
- className: void 0,
499
- hoisted: !1,
500
- id: void 0,
501
- portalContainer: "document.body",
502
- text: null
503
- }, R = /* @__PURE__ */ L((a, t) => {
504
- const {
505
- className: e,
506
- hoisted: o,
507
- id: r,
508
- portalContainer: s,
509
- text: p,
510
- ...i
511
- } = a, [d] = k(() => r || K()), f = h();
512
- P(t, () => f.current, []);
513
- const m = $(() => _(["lmnt", e, "lmnt-tooltip__text-content", "mdc-typography--caption"]), [e]);
514
- return /* @__PURE__ */ c.createElement(me, {
515
- disabled: !o,
516
- container: s
517
- }, /* @__PURE__ */ c.createElement("div", N({
518
- role: "tooltip",
519
- id: d,
520
- className: m
521
- }, i, {
522
- ref: f
523
- }), p));
524
- });
525
- R.displayName = "TooltipText";
526
- R.propTypes = Ee;
527
- R.defaultProps = be;
528
- const I = /* @__PURE__ */ L((a, t) => {
529
- const {
530
- children: e,
531
- className: o,
532
- containerType: r,
533
- hoisted: s,
534
- id: p,
535
- onClick: i,
536
- portalContainer: d,
537
- position: f,
538
- text: m,
539
- tooltipProps: v,
540
- triggerProps: z,
541
- ...J
542
- } = a, F = h(), E = h(), C = h();
543
- P(t, () => E.current, []);
544
- const [b] = k(() => p || K()), X = T(() => {
545
- i?.();
546
- }, [i]), Y = T((l) => {
547
- l.key === "Enter" && i?.();
548
- }, [i]);
549
- ne(() => {
550
- const l = [{
551
- name: "flip",
552
- options: {
553
- enabled: !0,
554
- padding: {
555
- bottom: 32,
556
- top: 32
557
- }
558
- }
559
- }];
560
- return s ? l.push({
561
- name: "offset",
562
- options: {
563
- offset: [0, 6]
564
- }
565
- }) : l.push({
566
- name: "offset",
567
- options: {
568
- offset: [0, 12]
569
- }
570
- }), F.current && E.current && (C.current = ae(F.current, E.current, {
571
- placement: f,
572
- modifiers: l
573
- })), () => {
574
- var u;
575
- (u = C.current) === null || u === void 0 || u.destroy();
576
- };
577
- }, [f, s]);
578
- const B = T(() => {
579
- var l, u, g;
580
- (l = E.current) === null || l === void 0 || l.setAttribute("data-show", ""), (u = C.current) === null || u === void 0 || u.setOptions((w) => ({
581
- ...w,
582
- modifiers: [...w.modifiers, {
583
- name: "eventListeners",
584
- enabled: !0
585
- }]
586
- })), (g = C.current) === null || g === void 0 || g.update();
587
- }, []), S = T(() => {
588
- var l, u;
589
- (l = E.current) === null || l === void 0 || l.removeAttribute("data-show"), (u = C.current) === null || u === void 0 || u.setOptions((g) => ({
590
- ...g,
591
- modifiers: [...g.modifiers, {
592
- name: "eventListeners",
593
- enabled: !1
594
- }]
595
- }));
596
- }, []), W = T(() => {
597
- const l = e;
598
- return l.type ? l.type === U : l === U;
599
- }, [e]);
600
- y(() => {
601
- const l = `Tooltips should only include short text for additional context and should not exceed three lines visually. (Toolitip ID ${b}).`;
602
- m && m.length > 100 && oe(l);
603
- }, [m, b]);
604
- const Z = $(
605
- // eslint-disable-next-line react/no-unstable-nested-components
606
- () => () => e ? typeof e == "string" || W(e) ? /* @__PURE__ */ c.createElement("span", {
607
- "aria-describedby": b
608
- }, e) : re(e, {
609
- "aria-describedby": b
610
- }) : null,
611
- [e, b, W]
612
- ), ee = i ? {
613
- tabIndex: 0,
614
- role: i ? "button" : "note",
615
- onKeyPress: Y,
616
- onClick: X
617
- } : {};
618
- return /* @__PURE__ */ c.createElement("span", N({
619
- className: _("lmnt lmnt-tooltip", r === "block" ? "lmnt-tooltip--block" : "lmnt-tooltip--inline")
620
- }, ee, J), /* @__PURE__ */ c.createElement("span", N({
621
- className: _("lmnt-tooltip__content", r === "block" ? "lmnt-tooltip--block" : "lmnt-tooltip--inline")
622
- }, z, {
623
- ref: F,
624
- onMouseEnter: B,
625
- onFocus: B,
626
- onMouseLeave: S,
627
- onBlur: S
628
- }), /* @__PURE__ */ c.createElement(Z, null)), m && /* @__PURE__ */ c.createElement(R, N({
629
- hoisted: s,
630
- portalContainer: d,
631
- role: "tooltip",
632
- id: b,
633
- className: o
634
- }, v, {
635
- ref: E,
636
- text: m
637
- })));
638
- });
639
- I.displayName = "Tooltip";
640
- I.propTypes = he;
641
- I.defaultProps = ye;
642
- const ge = {
643
- /**
644
- * Content to be rendered inside the label. Expects a string, though accepts any valid markup.
645
- *
646
- * Defaults to **null**.
647
- */
648
- children: n.node.isRequired,
649
- /**
650
- * The css class name to be passed through to the component markup.
651
- *
652
- * Defaults to **undefined**.
653
- */
654
- className: n.string,
655
- /**
656
- * The label will appear in the floating state.
657
- *
658
- * Defaults to **false**.
659
- */
660
- float: n.bool,
661
- /**
662
- * The id of the component to trigger on active
663
- *
664
- * Defaults to **empty string**.
665
- */
666
- htmlFor: n.string,
667
- /**
668
- * The label will shake briefly when set.
669
- *
670
- * Defaults to **false**.
671
- */
672
- shake: n.bool
673
- }, Ne = {
674
- children: null,
675
- className: void 0,
676
- float: !1,
677
- htmlFor: "",
678
- shake: !1
679
- }, x = /* @__PURE__ */ L((a, t) => {
680
- const {
681
- children: e,
682
- htmlFor: o = "",
683
- shake: r = !1,
684
- float: s = !1,
685
- className: p,
686
- style: i,
687
- ...d
688
- } = a, f = h(), m = e, v = h();
689
- return P(t, () => v.current, []), y(() => (f.current = ce.attachTo(v.current), () => {
690
- f.current.destroy();
691
- })), y(() => {
692
- f.current.float(s);
693
- }, [s]), /* @__PURE__ */ c.createElement("label", N({
694
- ref: v,
695
- htmlFor: o,
696
- className: _("lmnt", "mdc-floating-label", s && "mdc-floating-label--float-above", r && "mdc-floating-label--shake", p)
697
- }, d, {
698
- style: i
699
- }), m);
700
- });
701
- x.displayName = "FloatingLabel";
702
- x.propTypes = ge;
703
- x.defaultProps = Ne;
704
- const ve = {
705
- /**
706
- * Content to be rendered inside the notched outline. Accepts a string.
707
- *
708
- * Defaults to **null**.
709
- */
710
- children: n.node,
711
- /**
712
- * The css class name to be passed through to the component markup.
713
- *
714
- * Defaults to **undefined**.
715
- */
716
- className: n.string,
717
- /**
718
- * Determines if the notch is opened or closed.
719
- *
720
- * Defaults to **undefined**.
721
- */
722
- closed: n.bool,
723
- /**
724
- *
725
- *
726
- * Defaults to **null**.
727
- */
728
- width: n.number
729
- }, Ce = {
730
- children: null,
731
- className: void 0,
732
- closed: void 0,
733
- width: null
734
- }, M = /* @__PURE__ */ L((a, t) => {
735
- const {
736
- closed: e,
737
- className: o,
738
- children: r,
739
- width: s,
740
- ...p
741
- } = a, i = h(), d = h();
742
- return P(t, () => i.current, []), y(() => (d.current = ue.attachTo(i.current), () => {
743
- d.current.destroy();
744
- }), []), y(() => {
745
- e !== void 0 && (e ? d.current.closeNotch() : d.current.notch());
746
- }, [e]), y(() => {
747
- s ? d.current.foundation.adapter.setNotchWidthProperty(s) : d.current.foundation.adapter.removeNotchWidthProperty();
748
- }, [s]), /* @__PURE__ */ c.createElement("div", N({
749
- className: _("lmnt", "mdc-notched-outline", o),
750
- ref: i
751
- }, p), /* @__PURE__ */ c.createElement("div", {
752
- className: "mdc-notched-outline__leading"
753
- }), /* @__PURE__ */ c.createElement("div", {
754
- className: "mdc-notched-outline__notch"
755
- }, r), /* @__PURE__ */ c.createElement("div", {
756
- className: "mdc-notched-outline__trailing"
757
- }));
758
- });
759
- M.displayName = "NotchedOutline";
760
- M.propTypes = ve;
761
- M.defaultProps = Ce;
762
- export {
763
- x as F,
764
- ce as M,
765
- M as N,
766
- me as P,
767
- R as T,
768
- ue as a
769
- };