@oliasoft-open-source/react-ui-library 4.11.0-beta-3 → 4.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/404.html +1 -0
  2. package/dist/index.js +78 -58
  3. package/dist/index.js.map +1 -1
  4. package/dist/storybook/assets/{Color-KGDBMAHA-DeGjmgTY.js → Color-KGDBMAHA-C4DMqLTk.js} +1 -1
  5. package/dist/storybook/assets/{DocsRenderer-PKQXORMH-DJIj_qEG.js → DocsRenderer-PKQXORMH-4sK5I5fh.js} +1 -1
  6. package/dist/storybook/assets/{accordion.stories-BTxV-ybU.js → accordion.stories-BSRBp5Mg.js} +2 -2
  7. package/dist/storybook/assets/{afe.stories-DFQsvqIV.js → afe.stories-DM18uTAa.js} +2 -2
  8. package/dist/storybook/assets/{buttons-and-links-BHGzZGPV.js → buttons-and-links-BAJT7RF7.js} +1 -1
  9. package/dist/storybook/assets/{casing-loads.stories-CJpnsmsZ.js → casing-loads.stories-CE6GJ021.js} +2 -2
  10. package/dist/storybook/assets/{cell.stories-Bpl0Squh.js → cell.stories-BkZwSf40.js} +2 -2
  11. package/dist/storybook/assets/check-box.stories-BJ0ShmeC.js +97 -0
  12. package/dist/storybook/assets/check-box.test-case.stories-CzuYZkUh.js +30 -0
  13. package/dist/storybook/assets/{chunk-HLWAVYOI-D2p4xoma.js → chunk-HLWAVYOI-wyESLsMA.js} +1 -1
  14. package/dist/storybook/assets/{color-D9KYOiNh.js → color-CXm-Xks7.js} +1 -1
  15. package/dist/storybook/assets/enum-Bnn40S8Q.js +1 -0
  16. package/dist/storybook/assets/footer.stories-C1SojIiD.js +3 -0
  17. package/dist/storybook/assets/form.stories-BLcmnfy8.js +49 -0
  18. package/dist/storybook/assets/{formation.stories-BT8VrcqV.js → formation.stories-DZ9-Ct5F.js} +2 -2
  19. package/dist/storybook/assets/helpers-JJxzGegQ.js +1 -0
  20. package/dist/storybook/assets/iframe-DGCZgYKU.js +2 -0
  21. package/dist/storybook/assets/{index-C0Iaso0O.js → index-D-ApmKaY.js} +88 -88
  22. package/dist/storybook/assets/{index-CNkaN_wz.js → index-DHATsyTR.js} +1 -1
  23. package/dist/storybook/assets/{input-group.stories-CElwRt3p.js → input-group.stories-EhmORqH9.js} +3 -3
  24. package/dist/storybook/assets/{input-validation-Ccgprl1C.js → input-validation-BdnKKR1J.js} +2 -2
  25. package/dist/storybook/assets/{inputs-DtQ245kS.js → inputs-Cpi6xZLB.js} +2 -2
  26. package/dist/storybook/assets/{layout-forms-Bm7FYA3V.js → layout-forms-DxC0zO_Y.js} +5 -5
  27. package/dist/storybook/assets/{layout-general-V7ekuEG7.js → layout-general-Be4RMwPl.js} +1 -1
  28. package/dist/storybook/assets/menu.stories-DLJSzJa-.js +82 -0
  29. package/dist/storybook/assets/menu.test-case.stories-DyrNbGBs.js +3 -0
  30. package/dist/storybook/assets/modal.stories-DOgeTuHT.js +200 -0
  31. package/dist/storybook/assets/modal.test-case.stories-DQ1Izuq6.js +21 -0
  32. package/dist/storybook/assets/{number-input-Bpg4Yqmo.js → number-input-CJJvhIIv.js} +1 -1
  33. package/dist/storybook/assets/number-input.stories-CKVq60XH.js +89 -0
  34. package/dist/storybook/assets/number-input.test-case.stories-Dh1F7N8M.js +92 -0
  35. package/dist/storybook/assets/{padding-and-spacing-IKi7rvQ-.js → padding-and-spacing-BZdh5XRo.js} +1 -1
  36. package/dist/storybook/assets/{pagination-CLt-kUlx.js → pagination-DWc8zp3k.js} +1 -1
  37. package/dist/storybook/assets/{pagination.stories-CTRM0Xou.js → pagination.stories-B5cOvzik.js} +2 -2
  38. package/dist/storybook/assets/popover.stories-p9_-pH_Q.js +10 -0
  39. package/dist/storybook/assets/{preview-ZgLLfBPl.js → preview-B3bzTGOp.js} +2 -2
  40. package/dist/storybook/assets/{preview-CtQzjqBP.js → preview-NGnahGuq.js} +1 -1
  41. package/dist/storybook/assets/{projects.stories-BQswWVCx.js → projects.stories-Co_WnKSx.js} +2 -2
  42. package/dist/storybook/assets/{radio-button-DmDuw4DA.js → radio-button-C4ljBRED.js} +1 -1
  43. package/dist/storybook/assets/radio-button.stories-D1rWr6ms.js +61 -0
  44. package/dist/storybook/assets/radio-button.test-case.stories-DglmHlWs.js +11 -0
  45. package/dist/storybook/assets/{reservoirs.stories-B12tIrmZ.js → reservoirs.stories-UW_8sofe.js} +2 -2
  46. package/dist/storybook/assets/{rich-text-input.stories-DkaOBgbE.js → rich-text-input.stories-CK_OTGiV.js} +3 -3
  47. package/dist/storybook/assets/{row.stories-msEoNdGI.js → row.stories-D11wLSt6.js} +2 -2
  48. package/dist/storybook/assets/select-03uRbc4I.js +61 -0
  49. package/dist/storybook/assets/select.input-CJed_LLR.js +1 -0
  50. package/dist/storybook/assets/select.stories-Bpffz9TF.js +498 -0
  51. package/dist/storybook/assets/select.stories-data-DxgWKlU6.js +1 -0
  52. package/dist/storybook/assets/select.test-case.stories-DwDNDHax.js +82 -0
  53. package/dist/storybook/assets/{site.stories-umpPYjkq.js → site.stories-ZGohyW6Z.js} +2 -2
  54. package/dist/storybook/assets/{table-5Y5KPNSk.js → table-DyOsClUv.js} +1 -1
  55. package/dist/storybook/assets/{table.stories-Clltxls0.js → table.stories-C1GgZCCR.js} +2 -2
  56. package/dist/storybook/assets/{tabs-C3NG6m9W.js → tabs-BoToLVEP.js} +1 -1
  57. package/dist/storybook/assets/tabs.stories-B52iEaHf.js +30 -0
  58. package/dist/storybook/assets/{title.stories-CsrYTGde.js → title.stories-jatDyjoM.js} +3 -3
  59. package/dist/storybook/assets/toaster.stories-G6nKp3uV.js +84 -0
  60. package/dist/storybook/assets/toaster.test-case.stories-CCHTh_U1.js +6 -0
  61. package/dist/storybook/assets/toggle.stories-BAislK3I.js +106 -0
  62. package/dist/storybook/assets/toggle.test-case.stories-CeUwdhGD.js +36 -0
  63. package/dist/storybook/assets/{tooltip.test-case.stories-CHibN8rC.js → tooltip.test-case.stories-C0wxGvKJ.js} +1 -1
  64. package/dist/storybook/assets/unit-input-CooRJQnF.js +10 -0
  65. package/dist/storybook/assets/unit-input.stories-zmSrl6iW.js +198 -0
  66. package/dist/storybook/assets/unit-input.test-case.stories-C1xRJ1EZ.js +220 -0
  67. package/dist/storybook/assets/unit-table.stories-Bl2gHPKG.js +152 -0
  68. package/dist/storybook/assets/unit-table.test-case.stories-DpSewGv4.js +1 -0
  69. package/dist/storybook/assets/use-previous-D775JrO6.js +1 -0
  70. package/dist/storybook/iframe.html +1 -1
  71. package/dist/storybook/index.json +1 -1
  72. package/dist/storybook/project.json +1 -1
  73. package/package.json +1 -1
  74. package/dist/storybook/assets/check-box.stories-DfbWw6mD.js +0 -126
  75. package/dist/storybook/assets/footer.stories-DgjDE_JR.js +0 -3
  76. package/dist/storybook/assets/form.stories-BrUnmw7R.js +0 -49
  77. package/dist/storybook/assets/iframe-B8VgeFPT.js +0 -2
  78. package/dist/storybook/assets/initialize-context-DOqEe1Xq.js +0 -1
  79. package/dist/storybook/assets/menu.stories-xWX80Eh2.js +0 -84
  80. package/dist/storybook/assets/modal.stories-LhoWfDE6.js +0 -220
  81. package/dist/storybook/assets/number-input.stories-DhCjZ37u.js +0 -180
  82. package/dist/storybook/assets/popover.stories-CGm0M5fv.js +0 -10
  83. package/dist/storybook/assets/radio-button.stories-5gvV0LD0.js +0 -71
  84. package/dist/storybook/assets/select-DnRuRG_N.js +0 -61
  85. package/dist/storybook/assets/select.input-D0UkAPd9.js +0 -1
  86. package/dist/storybook/assets/select.stories-B9w9ONzj.js +0 -579
  87. package/dist/storybook/assets/tabs.stories-dsXjRHJy.js +0 -30
  88. package/dist/storybook/assets/toaster.stories-HO4VBTy-.js +0 -89
  89. package/dist/storybook/assets/toggle.stories-qTHFTXxI.js +0 -141
  90. package/dist/storybook/assets/unit-input.stories-QnEpR0rY.js +0 -426
  91. package/dist/storybook/assets/unit-table.stories-BZCc0yfc.js +0 -152
@@ -0,0 +1 @@
1
+ import{i as y}from"./helpers-JJxzGegQ.js";import{M as m}from"./types-BmbYqTX_.js";const o=n=>n instanceof Array,v=(n,r)=>r&&Array.isArray(n)?n.map(t=>typeof t=="string"||typeof t=="number"?{label:t,value:t}:t):n,f=(n,r)=>{if(r!==null&&typeof r=="object"&&r.hasOwnProperty("label")&&r.hasOwnProperty("value"))return r;{const t=r!==null&&typeof r=="object"&&r.hasOwnProperty("value")?r.value:r;return(Array.isArray(n)?n.filter(e=>e.type!==m.HEADING).find(e=>e.value==t):void 0)||(y(t)?void 0:{value:t,label:t})}},p=(n,r)=>o(r)?r.map(u=>f(n,u)).filter(u=>u!==void 0):r===null?void 0:f(n,r),A=n=>Array.isArray(n)&&n.some(r=>typeof r=="string"||typeof r=="number"),b=(n,r)=>{const t=r instanceof Array?r.length?r[0]:null:r,u=t==null?null:typeof t=="string"||typeof t=="number"?t:t.value,e=n.filter(l=>l.type!==m.HEADING).findIndex(l=>typeof l=="string"||typeof l=="number"?l==u:l.value==u);return e===-1?null:e},S=(n,r)=>!(o(r)?r:y(r)?[]:[r]).every(e=>n.find(a=>a.value===e.value)!==void 0),g=(n,r,t,u)=>{const e=Array.isArray(n)?n:[],l=o(r),a=A(e),i=v(e,a),c=t?b(e,r):null,s=p(i,r),d=u&&s!==void 0?S(i,s):!1;return{options:i,selectedOptions:s,multi:l,simpleInputs:a,firstSelectedOptionIndex:c,hasNonExistentValue:d}};export{g as s};
@@ -0,0 +1,498 @@
1
+ import{j as s}from"./jsx-runtime-eps93zm2.js";import{r as _}from"./index-DhsZuJvc.js";import{S as F}from"./select-03uRbc4I.js";import{S as Sn}from"./spacer-BWoNR27H.js";import{o as Vn,a as Cn,b as bn,c as xn,d as yn,e as fn,f as jn,g as Wn,h as On,i as En}from"./select.stories-data-DxgWKlU6.js";import"./lodash-c4VUpsOs.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./types-Dx2TtIG9.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./enum-Bnn40S8Q.js";import"./index-CEuq6vkz.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./memoize-one.esm-CcMeOnPo.js";import"./types-BmbYqTX_.js";import"./text-B3-TSWok.js";import"./actions-D-uVCDzk.js";import"./button-DHevvVBE.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./badge-CLQ59MDF.js";import"./select.input-CJed_LLR.js";import"./helpers-JJxzGegQ.js";const na={title:"Forms/Select",component:F,args:{options:Vn,native:!1,multi:!1,disabled:!1,autoLayerWidth:!1,clearable:!1,searchable:!0,right:!1}},e=t=>{const{multi:o,value:P}=t,[M,H]=_.useState(P||(o?[]:void 0)),I=n=>{const{value:a}=n.target;H(o?a:{value:a})};return s.jsx(F,{value:M,onChange:I,...t})},k=e.bind({}),u=e.bind({});u.args={small:!0};const c=e.bind({});c.args={width:"auto"};const i=e.bind({});i.args={width:"200px"};const d=e.bind({});d.args={native:!0};const g=e.bind({});g.args={multi:!0,clearable:!0};const p=e.bind({});p.args={options:[]};const m=e.bind({});m.args={clearable:!0};const v=e.bind({});v.args={value:{label:"Vampires",value:"blood"}};const h=e.bind({});h.args={placeholder:"Select the best animal..."};const S=e.bind({});S.args={options:Cn};const V=e.bind({});V.args={options:bn};const C=e.bind({});C.args={options:xn};const b=e.bind({});b.args={options:yn};const x=e.bind({});x.args={options:fn};const y=e.bind({});y.args={searchable:!1};const f=e.bind({});f.args={right:!0};const l=e.bind({});l.parameters={docs:{description:{story:"Avoid autoLayerWidth for very long lists in custom selects (slow)"}}};l.args={width:"70px",autoLayerWidth:!0};const j=e.bind({});j.args={tooltip:"Some info"};const W=e.bind({});W.args={error:"Some info"};const O=e.bind({});O.args={warning:"Some info"};const E=e.bind({});E.args={disabled:!0};const w=e.bind({});w.args={options:jn,placeholder:void 0};const A=e.bind({});A.args={options:Wn};const L=e.bind({});L.args={options:On};const r=e.bind({});r.parameters={docs:{description:{story:"Avoid `width: auto` and autoLayerWidth for very long lists in custom selects (slow). Consider checkNonExistentValues={false}."}}};r.args={options:En};const N=e.bind({});N.args={deprecatedEventHandler:!0};const D=()=>{const[t,o]=_.useState([{label:"Aardvarks",value:"termites"},{label:"Kangaroos",value:"grass"},{label:"Monkeys",value:"bananas"},{label:"Possums",value:"slugs"}]),[P,M]=_.useState(void 0),[H,I]=_.useState([]);return s.jsxs(s.Fragment,{children:[s.jsx(F,{name:"example",options:t,onChange:n=>M({value:n.target.value}),onCreate:n=>{const a={label:n,value:n};o([...t,a]),M(a)},value:P,clearable:!0}),s.jsx(Sn,{}),s.jsx(F,{name:"example",options:t,onChange:n=>I(n.target.value),onCreate:n=>{const a={label:n,value:n};o([...t,a]),console.log(n),I([...H,a])},value:H,multi:!0,clearable:!0})]})};D.__docgenInfo={description:"",methods:[],displayName:"OnCreate"};var B,R,T;k.parameters={...k.parameters,docs:{...(B=k.parameters)==null?void 0:B.docs,source:{originalSource:`(args: any) => {
2
+ const {
3
+ multi,
4
+ value
5
+ } = args;
6
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
7
+ const handleChange = (evt: any) => {
8
+ const {
9
+ value
10
+ } = evt.target;
11
+ setSelectedValue(multi ? value : {
12
+ value
13
+ });
14
+ };
15
+ return <Select value={selectedValue} onChange={handleChange}
16
+ // eslint-disable-next-line react/jsx-props-no-spreading
17
+ {...args} />;
18
+ }`,...(T=(R=k.parameters)==null?void 0:R.docs)==null?void 0:T.source}}};var K,q,z;u.parameters={...u.parameters,docs:{...(K=u.parameters)==null?void 0:K.docs,source:{originalSource:`(args: any) => {
19
+ const {
20
+ multi,
21
+ value
22
+ } = args;
23
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
24
+ const handleChange = (evt: any) => {
25
+ const {
26
+ value
27
+ } = evt.target;
28
+ setSelectedValue(multi ? value : {
29
+ value
30
+ });
31
+ };
32
+ return <Select value={selectedValue} onChange={handleChange}
33
+ // eslint-disable-next-line react/jsx-props-no-spreading
34
+ {...args} />;
35
+ }`,...(z=(q=u.parameters)==null?void 0:q.docs)==null?void 0:z.source}}};var G,J,Q;c.parameters={...c.parameters,docs:{...(G=c.parameters)==null?void 0:G.docs,source:{originalSource:`(args: any) => {
36
+ const {
37
+ multi,
38
+ value
39
+ } = args;
40
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
41
+ const handleChange = (evt: any) => {
42
+ const {
43
+ value
44
+ } = evt.target;
45
+ setSelectedValue(multi ? value : {
46
+ value
47
+ });
48
+ };
49
+ return <Select value={selectedValue} onChange={handleChange}
50
+ // eslint-disable-next-line react/jsx-props-no-spreading
51
+ {...args} />;
52
+ }`,...(Q=(J=c.parameters)==null?void 0:J.docs)==null?void 0:Q.source}}};var U,X,Y;i.parameters={...i.parameters,docs:{...(U=i.parameters)==null?void 0:U.docs,source:{originalSource:`(args: any) => {
53
+ const {
54
+ multi,
55
+ value
56
+ } = args;
57
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
58
+ const handleChange = (evt: any) => {
59
+ const {
60
+ value
61
+ } = evt.target;
62
+ setSelectedValue(multi ? value : {
63
+ value
64
+ });
65
+ };
66
+ return <Select value={selectedValue} onChange={handleChange}
67
+ // eslint-disable-next-line react/jsx-props-no-spreading
68
+ {...args} />;
69
+ }`,...(Y=(X=i.parameters)==null?void 0:X.docs)==null?void 0:Y.source}}};var Z,$,ee;d.parameters={...d.parameters,docs:{...(Z=d.parameters)==null?void 0:Z.docs,source:{originalSource:`(args: any) => {
70
+ const {
71
+ multi,
72
+ value
73
+ } = args;
74
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
75
+ const handleChange = (evt: any) => {
76
+ const {
77
+ value
78
+ } = evt.target;
79
+ setSelectedValue(multi ? value : {
80
+ value
81
+ });
82
+ };
83
+ return <Select value={selectedValue} onChange={handleChange}
84
+ // eslint-disable-next-line react/jsx-props-no-spreading
85
+ {...args} />;
86
+ }`,...(ee=($=d.parameters)==null?void 0:$.docs)==null?void 0:ee.source}}};var ne,ae,te;g.parameters={...g.parameters,docs:{...(ne=g.parameters)==null?void 0:ne.docs,source:{originalSource:`(args: any) => {
87
+ const {
88
+ multi,
89
+ value
90
+ } = args;
91
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
92
+ const handleChange = (evt: any) => {
93
+ const {
94
+ value
95
+ } = evt.target;
96
+ setSelectedValue(multi ? value : {
97
+ value
98
+ });
99
+ };
100
+ return <Select value={selectedValue} onChange={handleChange}
101
+ // eslint-disable-next-line react/jsx-props-no-spreading
102
+ {...args} />;
103
+ }`,...(te=(ae=g.parameters)==null?void 0:ae.docs)==null?void 0:te.source}}};var se,le,re;p.parameters={...p.parameters,docs:{...(se=p.parameters)==null?void 0:se.docs,source:{originalSource:`(args: any) => {
104
+ const {
105
+ multi,
106
+ value
107
+ } = args;
108
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
109
+ const handleChange = (evt: any) => {
110
+ const {
111
+ value
112
+ } = evt.target;
113
+ setSelectedValue(multi ? value : {
114
+ value
115
+ });
116
+ };
117
+ return <Select value={selectedValue} onChange={handleChange}
118
+ // eslint-disable-next-line react/jsx-props-no-spreading
119
+ {...args} />;
120
+ }`,...(re=(le=p.parameters)==null?void 0:le.docs)==null?void 0:re.source}}};var oe,ue,ce;m.parameters={...m.parameters,docs:{...(oe=m.parameters)==null?void 0:oe.docs,source:{originalSource:`(args: any) => {
121
+ const {
122
+ multi,
123
+ value
124
+ } = args;
125
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
126
+ const handleChange = (evt: any) => {
127
+ const {
128
+ value
129
+ } = evt.target;
130
+ setSelectedValue(multi ? value : {
131
+ value
132
+ });
133
+ };
134
+ return <Select value={selectedValue} onChange={handleChange}
135
+ // eslint-disable-next-line react/jsx-props-no-spreading
136
+ {...args} />;
137
+ }`,...(ce=(ue=m.parameters)==null?void 0:ue.docs)==null?void 0:ce.source}}};var ie,de,ge;v.parameters={...v.parameters,docs:{...(ie=v.parameters)==null?void 0:ie.docs,source:{originalSource:`(args: any) => {
138
+ const {
139
+ multi,
140
+ value
141
+ } = args;
142
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
143
+ const handleChange = (evt: any) => {
144
+ const {
145
+ value
146
+ } = evt.target;
147
+ setSelectedValue(multi ? value : {
148
+ value
149
+ });
150
+ };
151
+ return <Select value={selectedValue} onChange={handleChange}
152
+ // eslint-disable-next-line react/jsx-props-no-spreading
153
+ {...args} />;
154
+ }`,...(ge=(de=v.parameters)==null?void 0:de.docs)==null?void 0:ge.source}}};var pe,me,ve;h.parameters={...h.parameters,docs:{...(pe=h.parameters)==null?void 0:pe.docs,source:{originalSource:`(args: any) => {
155
+ const {
156
+ multi,
157
+ value
158
+ } = args;
159
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
160
+ const handleChange = (evt: any) => {
161
+ const {
162
+ value
163
+ } = evt.target;
164
+ setSelectedValue(multi ? value : {
165
+ value
166
+ });
167
+ };
168
+ return <Select value={selectedValue} onChange={handleChange}
169
+ // eslint-disable-next-line react/jsx-props-no-spreading
170
+ {...args} />;
171
+ }`,...(ve=(me=h.parameters)==null?void 0:me.docs)==null?void 0:ve.source}}};var he,Se,Ve;S.parameters={...S.parameters,docs:{...(he=S.parameters)==null?void 0:he.docs,source:{originalSource:`(args: any) => {
172
+ const {
173
+ multi,
174
+ value
175
+ } = args;
176
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
177
+ const handleChange = (evt: any) => {
178
+ const {
179
+ value
180
+ } = evt.target;
181
+ setSelectedValue(multi ? value : {
182
+ value
183
+ });
184
+ };
185
+ return <Select value={selectedValue} onChange={handleChange}
186
+ // eslint-disable-next-line react/jsx-props-no-spreading
187
+ {...args} />;
188
+ }`,...(Ve=(Se=S.parameters)==null?void 0:Se.docs)==null?void 0:Ve.source}}};var Ce,be,xe;V.parameters={...V.parameters,docs:{...(Ce=V.parameters)==null?void 0:Ce.docs,source:{originalSource:`(args: any) => {
189
+ const {
190
+ multi,
191
+ value
192
+ } = args;
193
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
194
+ const handleChange = (evt: any) => {
195
+ const {
196
+ value
197
+ } = evt.target;
198
+ setSelectedValue(multi ? value : {
199
+ value
200
+ });
201
+ };
202
+ return <Select value={selectedValue} onChange={handleChange}
203
+ // eslint-disable-next-line react/jsx-props-no-spreading
204
+ {...args} />;
205
+ }`,...(xe=(be=V.parameters)==null?void 0:be.docs)==null?void 0:xe.source}}};var ye,fe,je;C.parameters={...C.parameters,docs:{...(ye=C.parameters)==null?void 0:ye.docs,source:{originalSource:`(args: any) => {
206
+ const {
207
+ multi,
208
+ value
209
+ } = args;
210
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
211
+ const handleChange = (evt: any) => {
212
+ const {
213
+ value
214
+ } = evt.target;
215
+ setSelectedValue(multi ? value : {
216
+ value
217
+ });
218
+ };
219
+ return <Select value={selectedValue} onChange={handleChange}
220
+ // eslint-disable-next-line react/jsx-props-no-spreading
221
+ {...args} />;
222
+ }`,...(je=(fe=C.parameters)==null?void 0:fe.docs)==null?void 0:je.source}}};var We,Oe,Ee;b.parameters={...b.parameters,docs:{...(We=b.parameters)==null?void 0:We.docs,source:{originalSource:`(args: any) => {
223
+ const {
224
+ multi,
225
+ value
226
+ } = args;
227
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
228
+ const handleChange = (evt: any) => {
229
+ const {
230
+ value
231
+ } = evt.target;
232
+ setSelectedValue(multi ? value : {
233
+ value
234
+ });
235
+ };
236
+ return <Select value={selectedValue} onChange={handleChange}
237
+ // eslint-disable-next-line react/jsx-props-no-spreading
238
+ {...args} />;
239
+ }`,...(Ee=(Oe=b.parameters)==null?void 0:Oe.docs)==null?void 0:Ee.source}}};var we,Ae,Le;x.parameters={...x.parameters,docs:{...(we=x.parameters)==null?void 0:we.docs,source:{originalSource:`(args: any) => {
240
+ const {
241
+ multi,
242
+ value
243
+ } = args;
244
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
245
+ const handleChange = (evt: any) => {
246
+ const {
247
+ value
248
+ } = evt.target;
249
+ setSelectedValue(multi ? value : {
250
+ value
251
+ });
252
+ };
253
+ return <Select value={selectedValue} onChange={handleChange}
254
+ // eslint-disable-next-line react/jsx-props-no-spreading
255
+ {...args} />;
256
+ }`,...(Le=(Ae=x.parameters)==null?void 0:Ae.docs)==null?void 0:Le.source}}};var Ne,De,Me;y.parameters={...y.parameters,docs:{...(Ne=y.parameters)==null?void 0:Ne.docs,source:{originalSource:`(args: any) => {
257
+ const {
258
+ multi,
259
+ value
260
+ } = args;
261
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
262
+ const handleChange = (evt: any) => {
263
+ const {
264
+ value
265
+ } = evt.target;
266
+ setSelectedValue(multi ? value : {
267
+ value
268
+ });
269
+ };
270
+ return <Select value={selectedValue} onChange={handleChange}
271
+ // eslint-disable-next-line react/jsx-props-no-spreading
272
+ {...args} />;
273
+ }`,...(Me=(De=y.parameters)==null?void 0:De.docs)==null?void 0:Me.source}}};var He,Ie,ke;f.parameters={...f.parameters,docs:{...(He=f.parameters)==null?void 0:He.docs,source:{originalSource:`(args: any) => {
274
+ const {
275
+ multi,
276
+ value
277
+ } = args;
278
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
279
+ const handleChange = (evt: any) => {
280
+ const {
281
+ value
282
+ } = evt.target;
283
+ setSelectedValue(multi ? value : {
284
+ value
285
+ });
286
+ };
287
+ return <Select value={selectedValue} onChange={handleChange}
288
+ // eslint-disable-next-line react/jsx-props-no-spreading
289
+ {...args} />;
290
+ }`,...(ke=(Ie=f.parameters)==null?void 0:Ie.docs)==null?void 0:ke.source}}};var _e,Fe,Pe;l.parameters={...l.parameters,docs:{...(_e=l.parameters)==null?void 0:_e.docs,source:{originalSource:`(args: any) => {
291
+ const {
292
+ multi,
293
+ value
294
+ } = args;
295
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
296
+ const handleChange = (evt: any) => {
297
+ const {
298
+ value
299
+ } = evt.target;
300
+ setSelectedValue(multi ? value : {
301
+ value
302
+ });
303
+ };
304
+ return <Select value={selectedValue} onChange={handleChange}
305
+ // eslint-disable-next-line react/jsx-props-no-spreading
306
+ {...args} />;
307
+ }`,...(Pe=(Fe=l.parameters)==null?void 0:Fe.docs)==null?void 0:Pe.source}}};var Be,Re,Te;j.parameters={...j.parameters,docs:{...(Be=j.parameters)==null?void 0:Be.docs,source:{originalSource:`(args: any) => {
308
+ const {
309
+ multi,
310
+ value
311
+ } = args;
312
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
313
+ const handleChange = (evt: any) => {
314
+ const {
315
+ value
316
+ } = evt.target;
317
+ setSelectedValue(multi ? value : {
318
+ value
319
+ });
320
+ };
321
+ return <Select value={selectedValue} onChange={handleChange}
322
+ // eslint-disable-next-line react/jsx-props-no-spreading
323
+ {...args} />;
324
+ }`,...(Te=(Re=j.parameters)==null?void 0:Re.docs)==null?void 0:Te.source}}};var Ke,qe,ze;W.parameters={...W.parameters,docs:{...(Ke=W.parameters)==null?void 0:Ke.docs,source:{originalSource:`(args: any) => {
325
+ const {
326
+ multi,
327
+ value
328
+ } = args;
329
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
330
+ const handleChange = (evt: any) => {
331
+ const {
332
+ value
333
+ } = evt.target;
334
+ setSelectedValue(multi ? value : {
335
+ value
336
+ });
337
+ };
338
+ return <Select value={selectedValue} onChange={handleChange}
339
+ // eslint-disable-next-line react/jsx-props-no-spreading
340
+ {...args} />;
341
+ }`,...(ze=(qe=W.parameters)==null?void 0:qe.docs)==null?void 0:ze.source}}};var Ge,Je,Qe;O.parameters={...O.parameters,docs:{...(Ge=O.parameters)==null?void 0:Ge.docs,source:{originalSource:`(args: any) => {
342
+ const {
343
+ multi,
344
+ value
345
+ } = args;
346
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
347
+ const handleChange = (evt: any) => {
348
+ const {
349
+ value
350
+ } = evt.target;
351
+ setSelectedValue(multi ? value : {
352
+ value
353
+ });
354
+ };
355
+ return <Select value={selectedValue} onChange={handleChange}
356
+ // eslint-disable-next-line react/jsx-props-no-spreading
357
+ {...args} />;
358
+ }`,...(Qe=(Je=O.parameters)==null?void 0:Je.docs)==null?void 0:Qe.source}}};var Ue,Xe,Ye;E.parameters={...E.parameters,docs:{...(Ue=E.parameters)==null?void 0:Ue.docs,source:{originalSource:`(args: any) => {
359
+ const {
360
+ multi,
361
+ value
362
+ } = args;
363
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
364
+ const handleChange = (evt: any) => {
365
+ const {
366
+ value
367
+ } = evt.target;
368
+ setSelectedValue(multi ? value : {
369
+ value
370
+ });
371
+ };
372
+ return <Select value={selectedValue} onChange={handleChange}
373
+ // eslint-disable-next-line react/jsx-props-no-spreading
374
+ {...args} />;
375
+ }`,...(Ye=(Xe=E.parameters)==null?void 0:Xe.docs)==null?void 0:Ye.source}}};var Ze,$e,en;w.parameters={...w.parameters,docs:{...(Ze=w.parameters)==null?void 0:Ze.docs,source:{originalSource:`(args: any) => {
376
+ const {
377
+ multi,
378
+ value
379
+ } = args;
380
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
381
+ const handleChange = (evt: any) => {
382
+ const {
383
+ value
384
+ } = evt.target;
385
+ setSelectedValue(multi ? value : {
386
+ value
387
+ });
388
+ };
389
+ return <Select value={selectedValue} onChange={handleChange}
390
+ // eslint-disable-next-line react/jsx-props-no-spreading
391
+ {...args} />;
392
+ }`,...(en=($e=w.parameters)==null?void 0:$e.docs)==null?void 0:en.source}}};var nn,an,tn;A.parameters={...A.parameters,docs:{...(nn=A.parameters)==null?void 0:nn.docs,source:{originalSource:`(args: any) => {
393
+ const {
394
+ multi,
395
+ value
396
+ } = args;
397
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
398
+ const handleChange = (evt: any) => {
399
+ const {
400
+ value
401
+ } = evt.target;
402
+ setSelectedValue(multi ? value : {
403
+ value
404
+ });
405
+ };
406
+ return <Select value={selectedValue} onChange={handleChange}
407
+ // eslint-disable-next-line react/jsx-props-no-spreading
408
+ {...args} />;
409
+ }`,...(tn=(an=A.parameters)==null?void 0:an.docs)==null?void 0:tn.source}}};var sn,ln,rn;L.parameters={...L.parameters,docs:{...(sn=L.parameters)==null?void 0:sn.docs,source:{originalSource:`(args: any) => {
410
+ const {
411
+ multi,
412
+ value
413
+ } = args;
414
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
415
+ const handleChange = (evt: any) => {
416
+ const {
417
+ value
418
+ } = evt.target;
419
+ setSelectedValue(multi ? value : {
420
+ value
421
+ });
422
+ };
423
+ return <Select value={selectedValue} onChange={handleChange}
424
+ // eslint-disable-next-line react/jsx-props-no-spreading
425
+ {...args} />;
426
+ }`,...(rn=(ln=L.parameters)==null?void 0:ln.docs)==null?void 0:rn.source}}};var on,un,cn;r.parameters={...r.parameters,docs:{...(on=r.parameters)==null?void 0:on.docs,source:{originalSource:`(args: any) => {
427
+ const {
428
+ multi,
429
+ value
430
+ } = args;
431
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
432
+ const handleChange = (evt: any) => {
433
+ const {
434
+ value
435
+ } = evt.target;
436
+ setSelectedValue(multi ? value : {
437
+ value
438
+ });
439
+ };
440
+ return <Select value={selectedValue} onChange={handleChange}
441
+ // eslint-disable-next-line react/jsx-props-no-spreading
442
+ {...args} />;
443
+ }`,...(cn=(un=r.parameters)==null?void 0:un.docs)==null?void 0:cn.source}}};var dn,gn,pn;N.parameters={...N.parameters,docs:{...(dn=N.parameters)==null?void 0:dn.docs,source:{originalSource:`(args: any) => {
444
+ const {
445
+ multi,
446
+ value
447
+ } = args;
448
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
449
+ const handleChange = (evt: any) => {
450
+ const {
451
+ value
452
+ } = evt.target;
453
+ setSelectedValue(multi ? value : {
454
+ value
455
+ });
456
+ };
457
+ return <Select value={selectedValue} onChange={handleChange}
458
+ // eslint-disable-next-line react/jsx-props-no-spreading
459
+ {...args} />;
460
+ }`,...(pn=(gn=N.parameters)==null?void 0:gn.docs)==null?void 0:pn.source}}};var mn,vn,hn;D.parameters={...D.parameters,docs:{...(mn=D.parameters)==null?void 0:mn.docs,source:{originalSource:`() => {
461
+ const [options, setOptions] = useState([{
462
+ label: 'Aardvarks',
463
+ value: 'termites'
464
+ }, {
465
+ label: 'Kangaroos',
466
+ value: 'grass'
467
+ }, {
468
+ label: 'Monkeys',
469
+ value: 'bananas'
470
+ }, {
471
+ label: 'Possums',
472
+ value: 'slugs'
473
+ }]);
474
+ const [singleValue, setSingleValue] = useState<ISelectSelectedOption | undefined>(undefined);
475
+ const [multiValue, setMultiValue] = useState<ISelectSelectedOption[]>([]);
476
+ return <>
477
+ <Select name="example" options={options} onChange={evt => setSingleValue({
478
+ value: evt.target.value
479
+ })} onCreate={value => {
480
+ const newValue = {
481
+ label: value,
482
+ value
483
+ };
484
+ setOptions([...options, newValue]);
485
+ setSingleValue(newValue);
486
+ }} value={singleValue} clearable />
487
+ <Spacer />
488
+ <Select name="example" options={options} onChange={evt => setMultiValue(evt.target.value)} onCreate={value => {
489
+ const newValue = {
490
+ label: value,
491
+ value
492
+ };
493
+ setOptions([...options, newValue]);
494
+ console.log(value);
495
+ setMultiValue([...multiValue, newValue]);
496
+ }} value={multiValue} multi clearable />
497
+ </>;
498
+ }`,...(hn=(vn=D.parameters)==null?void 0:vn.docs)==null?void 0:hn.source}}};const aa=["Default","Small","AutoWidth","FixedWidth","Native","Multiselect","Empty","Clearable","NonExistentValue","CustomPlaceholder","OptionsWithHeadings","OptionsWithDetails","OptionsWithIcons","OptionsWithActions","OptionsWithEverything","NotSearchable","RightAligned","AutoLayerWidth","Tooltip","Error","Warning","Disabled","NumericOptions","BooleanOptions","SimpleOptions","VeryLongList","DeprecatedEventHandler","OnCreate"];export{l as AutoLayerWidth,c as AutoWidth,A as BooleanOptions,m as Clearable,h as CustomPlaceholder,k as Default,N as DeprecatedEventHandler,E as Disabled,p as Empty,W as Error,i as FixedWidth,g as Multiselect,d as Native,v as NonExistentValue,y as NotSearchable,w as NumericOptions,D as OnCreate,b as OptionsWithActions,V as OptionsWithDetails,x as OptionsWithEverything,S as OptionsWithHeadings,C as OptionsWithIcons,f as RightAligned,L as SimpleOptions,u as Small,j as Tooltip,r as VeryLongList,O as Warning,aa as __namedExportsOrder,na as default};
@@ -0,0 +1 @@
1
+ import{j as s}from"./jsx-runtime-eps93zm2.js";import{I as l}from"./common-types-Sih75Sav.js";import{I as e}from"./icon-BSFY3vDO.js";const b=[{label:"Aardvarks",value:"termites"},{label:"Kangaroos",value:"grass"},{label:"Koalas",value:"leaves"},{label:"Monkeys",value:"bananas",disabled:!0},{label:"Wombats",value:"bark"}],u=[{label:"Kangaroos",value:"grass",details:"(grass)"},{label:"Monkeys",value:"bananas",details:"(bananas)"},{label:"Possums",value:"slugs",details:"(slugs)"}],c=[{type:"Heading",label:"Large"},{label:"Aardvarks",value:"termites"},{label:"Kangaroos",value:"grass"},{label:"Monkeys",value:"bananas"},{type:"Heading",label:"Small"},{label:"Possums",value:"slugs"}],v=[{label:1,value:1},{label:2,value:2},{label:3,value:3},{label:4,value:4}],g=[{label:"Yes",value:!0},{label:"No",value:!1}],m=[{label:"Aardvarks",value:"termites"},{label:"Monkeys",value:"bananas"},{label:"Vampires",value:"blood",icon:s.jsx(e,{icon:l.WARNING,color:"var(--color-text-warning)"})},{label:"Zombies",value:"brains",icon:s.jsx(e,{icon:l.ERROR,color:"var(--color-text-error)"})}],a=[{label:"Delete",icon:"delete",onClick:()=>{}},{label:"Rename",icon:"rename",onClick:()=>{}}],d=[{label:"Kangaroos",value:"grass",actions:a},{label:"Monkeys",value:"bananas",actions:a},{label:"Possums",value:"slugs",actions:a,details:"(some details)"}],p=[{label:"Kangaroos",value:"grass",actions:a,icon:s.jsx(e,{icon:l.WARNING,color:"var(--color-text-warning)"}),details:"(grass)"},{label:"Monkeys",value:"bananas",actions:a,icon:s.jsx(e,{icon:l.WARNING,color:"var(--color-text-warning)"}),details:"(bananas)"},{label:"Possums",value:"slugs",actions:a,icon:s.jsx(e,{icon:l.WARNING,color:"var(--color-text-warning)"}),details:"(slugs)"}],k=[...Array(1e4).keys()].map((n,o)=>({label:Math.random().toString(36).substring(7),value:o})),x=["Aardvarks","Kangaroos","Monkeys","Possums"];export{c as a,u as b,m as c,d,p as e,v as f,g,x as h,k as i,b as o};
@@ -0,0 +1,82 @@
1
+ import{j as _}from"./jsx-runtime-eps93zm2.js";import{r as I}from"./index-DhsZuJvc.js";import{w as r,e as s,u as l}from"./index-DMAnyMX5.js";import{S as T}from"./select-03uRbc4I.js";import{o as O}from"./select.stories-data-DxgWKlU6.js";import"./index-CF7H4eMJ.js";import"./lodash-c4VUpsOs.js";import"./index-Bk2sglWO.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./types-Dx2TtIG9.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./enum-Bnn40S8Q.js";import"./index-CEuq6vkz.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./memoize-one.esm-CcMeOnPo.js";import"./types-BmbYqTX_.js";import"./text-B3-TSWok.js";import"./actions-D-uVCDzk.js";import"./button-DHevvVBE.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./badge-CLQ59MDF.js";import"./select.input-CJed_LLR.js";import"./helpers-JJxzGegQ.js";const ue={title:"Forms/Select/Test Cases",component:T,args:{options:O},tags:["!autodocs"]},v=n=>{const{multi:o,value:e}=n,[a,t]=I.useState(e||(o?[]:void 0)),i=c=>{const{value:g}=c.target;t(o?g:{value:g})};return _.jsx(T,{value:a,onChange:i,...n})},y=v.bind({});y.args={value:{label:"Vampires",value:"blood"},disabled:!0};const d=v.bind({});d.args={testId:"testId",clearable:!0};d.play=async({canvasElement:n,step:o})=>{const e=n.parentElement?r(n.parentElement):null;await s(e).toBeTruthy(),e&&(await o("Select item with click",async()=>{const a=e.getByTestId("testId");await l.click(a);const t=e.getByTestId("testId-layer");await s(t).toBeInTheDocument();const i=r(t).getByText("Wombats");await l.click(i);const c=e.getByTestId("testId-value");await s(r(c).getByText("Wombats")).toBeInTheDocument()}),await o("Clear selected value",async()=>{const a=e.getByTestId("testId-clear");await l.click(a);const t=e.queryByTestId("testId-value");await s(t).not.toBeInTheDocument()}))};const m=v.bind({});m.args={testId:"testId",clearable:!0,multi:!0};m.play=async({canvasElement:n,step:o})=>{const e=n.parentElement?r(n.parentElement):null;await s(e).toBeTruthy(),e&&(await o("Select items with click",async()=>{const a=e.getByTestId("testId");await l.click(a);const t=e.getByTestId("testId-layer");await s(t).toBeInTheDocument();const i=r(t).getByText("Wombats");await l.click(i);const c=r(t).getByText("Kangaroos");await l.click(c),await l.click(n),await s(t).not.toBeInTheDocument();const g=e.getByTestId("testId-value");await s(r(g).getByText("Wombats")).toBeInTheDocument(),await s(r(g).getByText("Kangaroos")).toBeInTheDocument()}),await o("Deselect item with click",async()=>{const a=e.getByTestId("testId");await l.click(a);const t=e.getByTestId("testId-layer");await s(t).toBeInTheDocument();const i=r(t).getByText("Wombats");await l.click(i),await l.click(n),await s(t).not.toBeInTheDocument();const c=e.getByTestId("testId-value");await s(r(c).queryByText("Wombats")).not.toBeInTheDocument()}),await o("Clear selected values",async()=>{const a=e.getByTestId("testId-clear");await l.click(a);const t=e.queryByTestId("testId-value");await s(t).not.toBeInTheDocument()}))};const p=v.bind({});p.args={testId:"testId",disabled:!0};p.play=async({canvasElement:n,step:o})=>{const e=r(n);await o("Clicking disabled trigger should not show layer",async()=>{await e.getByTestId("testId").click();const t=e.queryByTestId("testId-layer");await s(t).toBeNull()})};const u=()=>{const[n,o]=I.useState(O),[e,a]=I.useState(void 0);return _.jsx(T,{testId:"testId",name:"example",options:n,onChange:t=>a({value:t.target.value}),onCreate:t=>{const i={label:t,value:t};o([...n,i]),a(i)},value:e})};u.args={testId:"testId"};u.play=async({canvasElement:n,step:o})=>{const e=n.parentElement?r(n.parentElement):null;await s(e).toBeTruthy(),e&&await o("Create new item",async()=>{const a=e.getByTestId("testId-input");if(s(a).toBeInTheDocument(),!a)return;await l.type(a,"New value");const t=e.getByText('Create "New value"');await l.click(t);const i=e.getByTestId("testId-value");await s(r(i).getByText("New value")).toBeInTheDocument()})};u.__docgenInfo={description:"",methods:[{name:"play",docblock:null,modifiers:["static"],params:[{name:"{ canvasElement, step }",optional:!1,type:null}],returns:null}],displayName:"TestCreate"};var w,h,B;y.parameters={...y.parameters,docs:{...(w=y.parameters)==null?void 0:w.docs,source:{originalSource:`(args: any) => {
2
+ const {
3
+ multi,
4
+ value
5
+ } = args;
6
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
7
+ const handleChange = (evt: any) => {
8
+ const {
9
+ value
10
+ } = evt.target;
11
+ setSelectedValue(multi ? value : {
12
+ value
13
+ });
14
+ };
15
+ return <Select value={selectedValue} onChange={handleChange}
16
+ // eslint-disable-next-line react/jsx-props-no-spreading
17
+ {...args} />;
18
+ }`,...(B=(h=y.parameters)==null?void 0:h.docs)==null?void 0:B.source}}};var S,V,x;d.parameters={...d.parameters,docs:{...(S=d.parameters)==null?void 0:S.docs,source:{originalSource:`(args: any) => {
19
+ const {
20
+ multi,
21
+ value
22
+ } = args;
23
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
24
+ const handleChange = (evt: any) => {
25
+ const {
26
+ value
27
+ } = evt.target;
28
+ setSelectedValue(multi ? value : {
29
+ value
30
+ });
31
+ };
32
+ return <Select value={selectedValue} onChange={handleChange}
33
+ // eslint-disable-next-line react/jsx-props-no-spreading
34
+ {...args} />;
35
+ }`,...(x=(V=d.parameters)==null?void 0:V.docs)==null?void 0:x.source}}};var b,C,f;m.parameters={...m.parameters,docs:{...(b=m.parameters)==null?void 0:b.docs,source:{originalSource:`(args: any) => {
36
+ const {
37
+ multi,
38
+ value
39
+ } = args;
40
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
41
+ const handleChange = (evt: any) => {
42
+ const {
43
+ value
44
+ } = evt.target;
45
+ setSelectedValue(multi ? value : {
46
+ value
47
+ });
48
+ };
49
+ return <Select value={selectedValue} onChange={handleChange}
50
+ // eslint-disable-next-line react/jsx-props-no-spreading
51
+ {...args} />;
52
+ }`,...(f=(C=m.parameters)==null?void 0:C.docs)==null?void 0:f.source}}};var D,k,j;p.parameters={...p.parameters,docs:{...(D=p.parameters)==null?void 0:D.docs,source:{originalSource:`(args: any) => {
53
+ const {
54
+ multi,
55
+ value
56
+ } = args;
57
+ const [selectedValue, setSelectedValue] = useState(value || (multi ? [] : undefined));
58
+ const handleChange = (evt: any) => {
59
+ const {
60
+ value
61
+ } = evt.target;
62
+ setSelectedValue(multi ? value : {
63
+ value
64
+ });
65
+ };
66
+ return <Select value={selectedValue} onChange={handleChange}
67
+ // eslint-disable-next-line react/jsx-props-no-spreading
68
+ {...args} />;
69
+ }`,...(j=(k=p.parameters)==null?void 0:k.docs)==null?void 0:j.source}}};var E,N,W;u.parameters={...u.parameters,docs:{...(E=u.parameters)==null?void 0:E.docs,source:{originalSource:`() => {
70
+ const [options, setOptions] = useState(storyData.options);
71
+ const [singleValue, setSingleValue] = useState<ISelectSelectedOption | undefined>(undefined);
72
+ return <Select testId="testId" name="example" options={options} onChange={evt => setSingleValue({
73
+ value: evt.target.value
74
+ })} onCreate={value => {
75
+ const newValue = {
76
+ label: value,
77
+ value
78
+ };
79
+ setOptions([...options, newValue]);
80
+ setSingleValue(newValue);
81
+ }} value={singleValue} />;
82
+ }`,...(W=(N=u.parameters)==null?void 0:N.docs)==null?void 0:W.source}}};const de=["TestDisabledNonExistentValue","Test","TestMulti","TestDisabled","TestCreate"];export{d as Test,u as TestCreate,p as TestDisabled,y as TestDisabledNonExistentValue,m as TestMulti,de as __namedExportsOrder,ue as default};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as x}from"./index-DhsZuJvc.js";import{I as j}from"./common-types-Sih75Sav.js";import{T as g}from"./top-bar-DkXSzzqt.js";import{S as w}from"./side-bar-CSx5wI-k.js";import{H as t}from"./heading-CRNoBc7q.js";import{B as L}from"./button-DHevvVBE.js";import{D as v}from"./drawer-DOWJp9T4.js";import{L as d}from"./list-bKpz6I9Q.js";import{F as l}from"./field-HrLaMLbx.js";import{I as a}from"./input-DTXbDJaL.js";import{C as m}from"./check-box-DPLaOkRR.js";import{P as f}from"./page-7SSpdYhb.js";import{R as o,C as i}from"./row-Bmiy2Lh0.js";import{A as u}from"./accordion-BiuI_LCA.js";import{S as s}from"./spacer-BWoNR27H.js";import{T as F}from"./tabs-C3NG6m9W.js";import"./index-Bk2sglWO.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./disabled-context-rmpd7YJS.js";import"./actions-D-uVCDzk.js";import"./lodash-c4VUpsOs.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./types-BmbYqTX_.js";import"./types-Dx2TtIG9.js";import"./badge-CLQ59MDF.js";import"./index-BI4_Bp97.js";import"./help-icon-Buhx5nl6.js";import"./spinner-AWUe4xwQ.js";import"./index.es-DazXb-ul.js";import"./redux-tRgGMjwY.js";import"./objectSpread2-DW4nTBoq.js";import"./tiny-invariant-DqLgxztJ.js";import"./memoize-one.esm-CcMeOnPo.js";import"./card-EcjmryU9.js";import"./meta-content-DWZbURV2.js";import"./loader-XHoVniao.js";import"./label-CqmyC9he.js";import"./styled-components.browser.esm-BQ9GQzDc.js";import"./select.input-D0UkAPd9.js";const C=[{label:"Import",value:"import",right:!0},{label:"Settings",value:"settings",right:!0}],S=()=>e.jsx("div",{style:{background:"#AAD3DF",borderLeft:"1px solid #8AB3BF",display:"flex",alignItems:"center",justifyContent:"center",color:"white",height:"100%"},children:"MAP"}),xe={title:"Layout/Layout Examples",parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}}},n=()=>{const[r,b]=x.useState(!0);return e.jsxs(e.Fragment,{children:[e.jsx(g,{}),e.jsx(w,{options:{title:"",sections:[]},width:"250px"}),e.jsx(f,{padding:!1,scroll:!1,children:e.jsxs(o,{spacing:0,flex:!0,children:[e.jsxs(v,{button:e.jsx(L,{onClick:()=>b(!r),round:!0,icon:j.CHEVRON_LEFT}),open:r,width:300,closedWidth:"var(--size-sidebar)",children:[e.jsx(d,{drawer:!0,narrow:!r,list:{name:"Sites",items:[{id:1,name:"Main Site",type:"Heading"},{id:2,name:"Site name here",active:!0,label:{value:1,color:"#69779b"}},{id:3,name:"Locations",type:"Heading"},{id:4,name:"Ipsum",label:{value:2,color:"#69779b"}},{id:5,name:"Dolor",label:{value:3,color:"#69779b"}}]}}),e.jsx(d,{drawer:!0,narrow:!r,list:{name:"Wells",items:[{id:1,name:"Main Wellbore",type:"Heading"},{id:2,name:"Lorem",label:{value:1,color:"#77699b"}}]}}),e.jsx(d,{drawer:!0,narrow:!r,list:{name:"Targets",items:[{id:1,name:"Lorem",label:{value:1,color:"#9b6977"}}]}})]}),e.jsxs(i,{borderLeft:!0,flexbox:!0,children:[e.jsx(s,{}),e.jsx(F,{padding:!0,margin:!1,options:C}),e.jsxs(o,{spacing:0,flex:!0,children:[e.jsxs(i,{scroll:!0,padding:!0,width:550,children:[e.jsx(t,{top:!0,children:"Site name here"}),e.jsx(l,{label:"Name",children:e.jsx(a,{value:"Site name here",width:"200px"})}),e.jsxs(u,{heading:e.jsx(t,{children:"Coordinate Reference System"}),managed:!0,children:[e.jsx(l,{label:"Label",labelLeft:!0,labelWidth:"50px",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{label:"Label",labelLeft:!0,labelWidth:"50px",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{label:"Label",labelLeft:!0,labelWidth:"50px",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{children:e.jsx(m,{label:"Dolor"})})]}),e.jsx(s,{}),e.jsx(t,{marginBottom:"var(--padding)",children:"Location"}),e.jsxs(o,{children:[e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})}),e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})}),e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})}),e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})})]}),e.jsx(s,{}),e.jsx(t,{marginBottom:"var(--padding)",children:"Model"}),e.jsxs(o,{children:[e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})}),e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})})]}),e.jsxs(u,{heading:e.jsx(t,{children:"Settings"}),managed:!0,children:[e.jsx(l,{children:e.jsx(m,{label:"Dolor"})}),e.jsxs(o,{children:[e.jsxs(i,{children:[e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})]}),e.jsxs(i,{children:[e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})]})]})]})]}),e.jsx(i,{children:e.jsx(S,{})})]})]})]})})]})};n.__docgenInfo={description:"",methods:[],displayName:"Site"};var p,c,h;n.parameters={...n.parameters,docs:{...(p=n.parameters)==null?void 0:p.docs,source:{originalSource:`() => {
1
+ import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as x}from"./index-DhsZuJvc.js";import{I as j}from"./common-types-Sih75Sav.js";import{T as g}from"./top-bar-DkXSzzqt.js";import{S as w}from"./side-bar-CSx5wI-k.js";import{H as t}from"./heading-CRNoBc7q.js";import{B as L}from"./button-DHevvVBE.js";import{D as v}from"./drawer-DOWJp9T4.js";import{L as d}from"./list-bKpz6I9Q.js";import{F as l}from"./field-HrLaMLbx.js";import{I as a}from"./input-DTXbDJaL.js";import{C as m}from"./check-box-DPLaOkRR.js";import{P as f}from"./page-7SSpdYhb.js";import{R as o,C as i}from"./row-Bmiy2Lh0.js";import{A as u}from"./accordion-BiuI_LCA.js";import{S as s}from"./spacer-BWoNR27H.js";import{T as F}from"./tabs-BoToLVEP.js";import"./index-Bk2sglWO.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DP0QEDDI.js";import"./index-CEuq6vkz.js";import"./disabled-context-rmpd7YJS.js";import"./actions-D-uVCDzk.js";import"./lodash-c4VUpsOs.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./types-BmbYqTX_.js";import"./types-Dx2TtIG9.js";import"./badge-CLQ59MDF.js";import"./index-BI4_Bp97.js";import"./help-icon-Buhx5nl6.js";import"./spinner-AWUe4xwQ.js";import"./index.es-DazXb-ul.js";import"./redux-tRgGMjwY.js";import"./objectSpread2-DW4nTBoq.js";import"./tiny-invariant-DqLgxztJ.js";import"./memoize-one.esm-CcMeOnPo.js";import"./card-EcjmryU9.js";import"./meta-content-DWZbURV2.js";import"./loader-XHoVniao.js";import"./label-CqmyC9he.js";import"./styled-components.browser.esm-BQ9GQzDc.js";import"./select.input-CJed_LLR.js";import"./helpers-JJxzGegQ.js";const C=[{label:"Import",value:"import",right:!0},{label:"Settings",value:"settings",right:!0}],S=()=>e.jsx("div",{style:{background:"#AAD3DF",borderLeft:"1px solid #8AB3BF",display:"flex",alignItems:"center",justifyContent:"center",color:"white",height:"100%"},children:"MAP"}),je={title:"Layout/Layout Examples",parameters:{layout:"fullscreen",docs:{story:{inline:!1,iframeHeight:400}}}},n=()=>{const[r,b]=x.useState(!0);return e.jsxs(e.Fragment,{children:[e.jsx(g,{}),e.jsx(w,{options:{title:"",sections:[]},width:"250px"}),e.jsx(f,{padding:!1,scroll:!1,children:e.jsxs(o,{spacing:0,flex:!0,children:[e.jsxs(v,{button:e.jsx(L,{onClick:()=>b(!r),round:!0,icon:j.CHEVRON_LEFT}),open:r,width:300,closedWidth:"var(--size-sidebar)",children:[e.jsx(d,{drawer:!0,narrow:!r,list:{name:"Sites",items:[{id:1,name:"Main Site",type:"Heading"},{id:2,name:"Site name here",active:!0,label:{value:1,color:"#69779b"}},{id:3,name:"Locations",type:"Heading"},{id:4,name:"Ipsum",label:{value:2,color:"#69779b"}},{id:5,name:"Dolor",label:{value:3,color:"#69779b"}}]}}),e.jsx(d,{drawer:!0,narrow:!r,list:{name:"Wells",items:[{id:1,name:"Main Wellbore",type:"Heading"},{id:2,name:"Lorem",label:{value:1,color:"#77699b"}}]}}),e.jsx(d,{drawer:!0,narrow:!r,list:{name:"Targets",items:[{id:1,name:"Lorem",label:{value:1,color:"#9b6977"}}]}})]}),e.jsxs(i,{borderLeft:!0,flexbox:!0,children:[e.jsx(s,{}),e.jsx(F,{padding:!0,margin:!1,options:C}),e.jsxs(o,{spacing:0,flex:!0,children:[e.jsxs(i,{scroll:!0,padding:!0,width:550,children:[e.jsx(t,{top:!0,children:"Site name here"}),e.jsx(l,{label:"Name",children:e.jsx(a,{value:"Site name here",width:"200px"})}),e.jsxs(u,{heading:e.jsx(t,{children:"Coordinate Reference System"}),managed:!0,children:[e.jsx(l,{label:"Label",labelLeft:!0,labelWidth:"50px",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{label:"Label",labelLeft:!0,labelWidth:"50px",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{label:"Label",labelLeft:!0,labelWidth:"50px",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{children:e.jsx(m,{label:"Dolor"})})]}),e.jsx(s,{}),e.jsx(t,{marginBottom:"var(--padding)",children:"Location"}),e.jsxs(o,{children:[e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})}),e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})}),e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})}),e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})})]}),e.jsx(s,{}),e.jsx(t,{marginBottom:"var(--padding)",children:"Model"}),e.jsxs(o,{children:[e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})}),e.jsx(i,{children:e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})})]}),e.jsxs(u,{heading:e.jsx(t,{children:"Settings"}),managed:!0,children:[e.jsx(l,{children:e.jsx(m,{label:"Dolor"})}),e.jsxs(o,{children:[e.jsxs(i,{children:[e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})]}),e.jsxs(i,{children:[e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})}),e.jsx(l,{label:"Label",children:e.jsx(a,{value:"Value",width:"100%"})})]})]})]})]}),e.jsx(i,{children:e.jsx(S,{})})]})]})]})})]})};n.__docgenInfo={description:"",methods:[],displayName:"Site"};var p,c,h;n.parameters={...n.parameters,docs:{...(p=n.parameters)==null?void 0:p.docs,source:{originalSource:`() => {
2
2
  const [open, setOpen] = useState(true);
3
3
  return <>
4
4
  <TopBar />
@@ -163,4 +163,4 @@ import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as x}from"./index-DhsZuJv
163
163
  </Row>
164
164
  </Page>
165
165
  </>;
166
- }`,...(h=(c=n.parameters)==null?void 0:c.docs)==null?void 0:h.source}}};const je=["Site"];export{n as Site,je as __namedExportsOrder,xe as default};
166
+ }`,...(h=(c=n.parameters)==null?void 0:c.docs)==null?void 0:h.source}}};const ge=["Site"];export{n as Site,ge as __namedExportsOrder,je as default};