@acusti/uikit-docs 0.4.4 → 0.4.6

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 (84) hide show
  1. package/.storybook/main.ts +19 -4
  2. package/CHANGELOG.md +60 -0
  3. package/dist/assets/CSSValueInput-B69U5DrZ.js +5 -0
  4. package/dist/assets/{CSSValueInput-BgAgo3f9.css → CSSValueInput-DKgB9IQs.css} +1 -1
  5. package/dist/assets/CSSValueInput.stories-vCftVQHX.js +113 -0
  6. package/dist/assets/Color-6BZIO3FS-BHsDhiaJ.js +1 -0
  7. package/dist/assets/DatePicker.stories-X2JO2cn6.js +585 -0
  8. package/dist/assets/DocsRenderer-LL677BLK-i2bqAbNY.js +2 -0
  9. package/dist/assets/Dropdown-QkqMQiyU.css +1 -0
  10. package/dist/assets/Dropdown-_IIsqrAA.js +101 -0
  11. package/dist/assets/Dropdown.stories-msGED41R.js +364 -0
  12. package/dist/assets/InputText-_BMv0r1n.css +1 -0
  13. package/dist/assets/InputText.stories-CG1EnzrQ.js +148 -0
  14. package/dist/assets/Introduction-orXeKug7.js +184 -0
  15. package/dist/assets/MonthCalendar.stories-CJT-JiqF.js +177 -0
  16. package/dist/assets/WithTooltip-65CFNBJE-DlgYg9W2.js +9 -0
  17. package/dist/assets/blocks-C4xgyV4X.js +46 -0
  18. package/dist/assets/chunk-242VQQM5-DEt_wvrI.js +1 -0
  19. package/dist/assets/chunk-YKABRMAI-BpCcWWoG.js +18 -0
  20. package/dist/assets/client-Bvdml6v2.js +9 -0
  21. package/dist/assets/clsx-Bdud1Ih_.js +1 -0
  22. package/dist/assets/compiler-runtime-BOsKKfMw.js +1 -0
  23. package/dist/assets/components-CuDS54ZU.js +92 -0
  24. package/dist/assets/dist-6e4YoSiG.js +1 -0
  25. package/dist/assets/dist-BreUZhw6.js +1 -0
  26. package/dist/assets/formatter-EIJCOSYU-4RP_9NAI.js +1 -0
  27. package/dist/assets/iframe-BsC6HWDY.js +1221 -0
  28. package/dist/assets/jsx-runtime-CZwoFFIL.js +1 -0
  29. package/dist/assets/lib-WXkUx4TK.js +1 -0
  30. package/dist/assets/preload-helper-Bhb7V-Yo.js +1 -0
  31. package/dist/assets/react-18-6aLPZbD-.js +1 -0
  32. package/dist/assets/react-DcwytXSz.js +1 -0
  33. package/dist/assets/react-dom-CFVoDXTy.js +1 -0
  34. package/dist/assets/syntaxhighlighter-ED5Y7EFY-BQSv6pbL.js +6 -0
  35. package/dist/assets/theming-DLDZLcJn.js +39 -0
  36. package/dist/assets/useIsOutOfBounds.stories-CI4DMSUD.js +105 -0
  37. package/dist/assets/{useKeyboardEvents-BH4Zd7d3.css → useKeyboardEvents-CKMYGqVT.css} +1 -1
  38. package/dist/assets/useKeyboardEvents.stories-CNX299tr.js +3 -0
  39. package/dist/favicon-wrapper.svg +46 -0
  40. package/dist/favicon.svg +1 -1
  41. package/dist/iframe.html +59 -40
  42. package/dist/index.html +8 -16
  43. package/dist/index.json +1 -1
  44. package/dist/project.json +1 -1
  45. package/dist/sb-addons/docs-1/manager-bundle.js +1 -149
  46. package/dist/sb-addons/storybook-2/manager-bundle.js +1 -1
  47. package/dist/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +548 -108
  48. package/dist/sb-common-assets/favicon-wrapper.svg +46 -0
  49. package/dist/sb-common-assets/favicon.svg +1 -1
  50. package/dist/sb-manager/globals-runtime.js +73064 -67182
  51. package/dist/sb-manager/globals.js +6 -16
  52. package/dist/sb-manager/manager-stores.js +23 -0
  53. package/dist/sb-manager/runtime.js +17712 -10309
  54. package/dist/vite-inject-mocker-entry.js +2 -0
  55. package/package.json +11 -9
  56. package/stories/CSSValueInput.stories.tsx +1 -1
  57. package/stories/DatePicker.stories.tsx +182 -45
  58. package/stories/InputText.stories.tsx +36 -0
  59. package/tsconfig.json +1 -0
  60. package/tsconfig.tsbuildinfo +1 -1
  61. package/dist/assets/CSSValueInput-BoZriUnh.js +0 -1
  62. package/dist/assets/CSSValueInput.stories-D1VcYZJ0.js +0 -113
  63. package/dist/assets/Color-AVL7NMMY-BeW0C7pE.js +0 -1
  64. package/dist/assets/DatePicker.stories-BSWV31FV.js +0 -244
  65. package/dist/assets/DocsRenderer-PQXLIZUC-D92GwNti.js +0 -2
  66. package/dist/assets/Dropdown-D5cyjefk.css +0 -1
  67. package/dist/assets/Dropdown-DUP_ybXe.js +0 -84
  68. package/dist/assets/Dropdown.stories-2Wtw1otE.js +0 -336
  69. package/dist/assets/InputText-Tkbh5amB.css +0 -1
  70. package/dist/assets/InputText.stories-BYt2Aj0_.js +0 -90
  71. package/dist/assets/Introduction-nSE2hjmb.js +0 -183
  72. package/dist/assets/MonthCalendar.stories-IJrL6wIl.js +0 -169
  73. package/dist/assets/blocks-Du178fXa.js +0 -658
  74. package/dist/assets/client-B2qWCcIR.js +0 -25
  75. package/dist/assets/clsx-hXifHU8N.js +0 -9
  76. package/dist/assets/iframe-ByGa_ItU.js +0 -1102
  77. package/dist/assets/index-BRXcJgsA.js +0 -1
  78. package/dist/assets/index-BVajFqaV.js +0 -1
  79. package/dist/assets/index-DwJ-mRZ2.js +0 -9
  80. package/dist/assets/jsx-runtime-D_zvdyIk.js +0 -9
  81. package/dist/assets/react-18-djOrgGe8.js +0 -1
  82. package/dist/assets/useIsOutOfBounds.stories-e48KZd_G.js +0 -105
  83. package/dist/assets/useKeyboardEvents.stories-CJbDuGfk.js +0 -3
  84. package/dist/sb-manager/globals-module-info.js +0 -797
@@ -1,336 +0,0 @@
1
- import{r as e,R as ie}from"./iframe-ByGa_ItU.js";import{C as g}from"./CSSValueInput-BoZriUnh.js";import{D as re}from"./Dropdown-DUP_ybXe.js";/* empty css */import"./jsx-runtime-D_zvdyIk.js";import"./clsx-hXifHU8N.js";import"./index-BRXcJgsA.js";const{fn:l}=__STORYBOOK_MODULE_TEST__,{Fragment:se}=ie,Ee={component:re,parameters:{docs:{description:{component:"`Dropdown` is a React component that renders a menu-like UI with a trigger that the user clicks to disclose a dropdown positioned below the trigger. The body of the dropdown can include any DOM, and many dropdowns can be combined to form a multi-item menu, like the system menu in the top toolbar of macOS."}}},tags:["autodocs"],title:"UIKit/Controls/Dropdown"},n={args:{children:e.createElement("ul",null,e.createElement("li",null,"0px"),e.createElement("li",null,"4px"),e.createElement("li",null,"9px"),e.createElement("li",null,"18px"),e.createElement("li",null,"36px"),e.createElement("li",null,"54px"),e.createElement("li",null,"72px"),e.createElement("li",null,"144px"),e.createElement("li",null,"167px"),e.createElement("li",null,"198px")),className:"css-lengths no-trigger-text"}},t={args:{children:e.createElement("ul",null,e.createElement("li",null,"Alabama"),e.createElement("li",null,"Alaska"),e.createElement("li",null,"Arizona"),e.createElement("li",null,"Arkansas"),e.createElement("li",null,"California"),e.createElement("li",null,"Colorado"),e.createElement("li",null,"Connecticut"),e.createElement("li",null,"Delaware"),e.createElement("li",null,"Florida"),e.createElement("li",null,"Georgia"),e.createElement("li",null,"Hawaii"),e.createElement("li",null,"Idaho"),e.createElement("li",null,"Illinois"),e.createElement("li",null,"Indiana"),e.createElement("li",null,"Iowa"),e.createElement("li",null,"Kansas"),e.createElement("li",null,"Kentucky"),e.createElement("li",null,"Louisiana"),e.createElement("li",null,"Maine"),e.createElement("li",null,"Maryland"),e.createElement("li",null,"Massachusetts"),e.createElement("li",null,"Michigan"),e.createElement("li",null,"Minnesota"),e.createElement("li",null,"Mississippi"),e.createElement("li",null,"Missouri"),e.createElement("li",null,"Montana"),e.createElement("li",null,"Nebraska"),e.createElement("li",null,"Nevada"),e.createElement("li",null,"New Hampshire"),e.createElement("li",null,"New Jersey"),e.createElement("li",null,"New Mexico"),e.createElement("li",null,"New York"),e.createElement("li",null,"North Carolina"),e.createElement("li",null,"North Dakota"),e.createElement("li",null,"Ohio"),e.createElement("li",null,"Oklahoma"),e.createElement("li",null,"Oregon"),e.createElement("li",null,"Pennsylvania"),e.createElement("li",null,"Rhode Island"),e.createElement("li",null,"South Carolina"),e.createElement("li",null,"South Dakota"),e.createElement("li",null,"Tennessee"),e.createElement("li",null,"Texas"),e.createElement("li",null,"Utah"),e.createElement("li",null,"Vermont"),e.createElement("li",null,"Virginia"),e.createElement("li",null,"Washington"),e.createElement("li",null,"West Virginia"),e.createElement("li",null,"Wisconsin"),e.createElement("li",null,"Wyoming")),className:"states-dropdown",isSearchable:!0,placeholder:"Choose a state…"}},a={args:{children:e.createElement("ul",null,e.createElement("li",{"data-ukt-value":"100"},e.createElement("span",{className:"item-title"},"Font Weight - "),"100"),e.createElement("li",{"data-ukt-value":"200"},e.createElement("span",{className:"item-title"},"Font Weight - "),"200"),e.createElement("li",{"data-ukt-value":"300"},e.createElement("span",{className:"item-title"},"Font Weight - "),"300"),e.createElement("li",{"data-ukt-value":"400"},e.createElement("span",{className:"item-title"},"Font Weight - "),"400"),e.createElement("li",{"data-ukt-value":"500"},e.createElement("span",{className:"item-title"},"Font Weight - "),"500"),e.createElement("li",{"data-ukt-value":"600"},e.createElement("span",{className:"item-title"},"Font Weight - "),"600"),e.createElement("li",{"data-ukt-value":"700"},e.createElement("span",{className:"item-title"},"Font Weight - "),"700")),className:"font-weight",isSearchable:!0}},i={args:{children:["View menu",e.createElement(se,null,e.createElement("h4",{className:"heading"},"View"),e.createElement("ul",null,e.createElement("li",{"data-ukt-item":!0},"Open"),e.createElement("li",{"data-ukt-item":!0},"Preview")),e.createElement("h4",{className:"heading"},"Edit"),e.createElement("ul",null,e.createElement("li",{"data-ukt-value":"save-item"},"Save"),e.createElement("li",{"data-ukt-value":"edit-item"},"Edit"),e.createElement("li",{"data-ukt-value":"delete-item"},"Delete")))],className:"open-on-mount-context-menu",isOpenOnMount:!0,onClick:l(),onClose:l(),onMouseDown:l(),onMouseUp:l(),onOpen:l(),onSubmitItem:l()}},r={args:{children:["Open",e.createElement("div",null,e.createElement("p",null,"Try interacting with the controls here. The dropdown should only close when you click outside of the entire dropdown or if you hit the escape key when focus isn’t in the input controls."),e.createElement(g,{cssValueType:"length",label:"Width",onSubmitValue:()=>{},placeholder:"100vw",unit:"vw"}),e.createElement(g,{cssValueType:"length",label:"Rotation",onSubmitValue:()=>{},placeholder:"0deg",step:5,unit:"deg"}))],className:"dropdown-without-items",hasItems:!1}},s={args:{children:e.createElement("ul",null,e.createElement("li",null,"0px"),e.createElement("li",null,"4px"),e.createElement("li",null,"9px"),e.createElement("li",null,"18px"),e.createElement("li",null,"36px"),e.createElement("li",null,"54px"),e.createElement("li",null,"72px"),e.createElement("li",null,"144px"),e.createElement("li",null,"167px"),e.createElement("li",null,"198px")),className:"searchable-with-label",isSearchable:!0,label:"Font size"}},o={args:{allowCreate:!0,children:e.createElement("ul",null,e.createElement("li",null,"0px"),e.createElement("li",null,"4px"),e.createElement("li",null,"9px"),e.createElement("li",null,"18px"),e.createElement("li",null,"36px"),e.createElement("li",null,"54px"),e.createElement("li",null,"72px"),e.createElement("li",null,"144px"),e.createElement("li",null,"167px"),e.createElement("li",null,"198px")),className:"searchable-and-allow-create",isSearchable:!0,label:"Font size"}},c={args:{allowCreate:!0,children:[e.createElement(g,{name:"cssinputbackgroundsize",onSubmitValue:()=>{},placeholder:"cover",validator:/^(auto|contain|cover)$/}),e.createElement("ul",null,e.createElement("li",null,"cover"),e.createElement("li",null,"contain"),e.createElement("li",null,"auto"),e.createElement("li",null,"50px"),e.createElement("li",null,"100px"),e.createElement("li",null,"200px"),e.createElement("li",null,"50%"))],className:"css-value-input-trigger",hasItems:!0,label:"Background size"}},u={args:{children:[e.createElement("textarea",null),e.createElement("ul",null,e.createElement("li",null,"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque ullamcorper fringilla quam, vel tincidunt nisl mattis vel."),e.createElement("li",null,"Aenean posuere erat sed enim luctus, et accumsan nisl elementum. Nulla vel blandit urna, vel accumsan nulla. Nulla varius luctus ex, gravida ultrices orci sagittis eu."),e.createElement("li",null,"Quisque vitae magna euismod ligula molestie maximus id et nunc. Nam et lacus euismod, porttitor massa vel, sollicitudin ex. Sed ut tellus suscipit, faucibus tortor nec, fermentum mi."),e.createElement("li",null,"Nulla sagittis justo non accumsan sagittis. Cras a eros et dolor dapibus bibendum lobortis quis ante. Ut eget scelerisque massa."),e.createElement("li",null,"Vestibulum quis dignissim nunc. Mauris fringilla at nulla non lacinia. Etiam tristique elit non nisl finibus, fringilla hendrerit ligula hendrerit. Fusce eget leo lacinia, eleifend diam non, suscipit purus."))],className:"textarea-trigger",hasItems:!0}},m={args:{children:["Colors",e.createElement("ul",null,e.createElement("li",null,e.createElement("label",null,e.createElement("input",{type:"checkbox"})," Red")),e.createElement("li",null,e.createElement("label",null,e.createElement("input",{type:"checkbox"})," Blue")),e.createElement("li",null,e.createElement("label",null,e.createElement("input",{type:"checkbox"})," Yellow")),e.createElement("li",null,e.createElement("label",null,e.createElement("input",{type:"checkbox"})," Cyan")),e.createElement("li",null,e.createElement("label",null,e.createElement("input",{type:"checkbox"})," Orchid")),e.createElement("li",null,e.createElement("label",null,e.createElement("input",{type:"checkbox"})," Slate")))],className:"checkboxes",keepOpenOnSubmit:!0}},p={args:{children:e.createElement("ul",null,e.createElement("li",null,"0px"),e.createElement("li",null,"4px"),e.createElement("li",null,"9px"),e.createElement("li",null,"18px"),e.createElement("li",null,"36px"),e.createElement("li",null,"54px"),e.createElement("li",null,"72px"),e.createElement("li",null,"144px"),e.createElement("li",null,"167px"),e.createElement("li",null,"198px")),className:"disabled-dropdown",disabled:!0,isSearchable:!0,label:"Disabled",name:"disabledexample",value:"167px"}},d={args:{children:e.createElement("ul",null,e.createElement("li",null,"the carbon in our apple pies"),e.createElement("li",null,"sea of tranquility tesseract"),e.createElement("li",null,"encyclopaedia galactica"),e.createElement("li",null,"billions upon billions"),e.createElement("li",null,"network of wormholes"),e.createElement("li",null,"tingling of the spine"),e.createElement("li",null,"corpus callosum"),e.createElement("li",null,"finite but unbounded")),className:"overlapping-dropdown no-trigger-text"}},h={args:{children:e.createElement("ul",null,e.createElement("li",null,"0px"),e.createElement("li",null,"4px"),e.createElement("li",null,"9px"),e.createElement("li",null,"18px"),e.createElement("li",null,"36px"),e.createElement("li",null,"54px"),e.createElement("li",null,"72px"),e.createElement("li",null,"144px"),e.createElement("li",null,"167px"),e.createElement("li",null,"198px")),className:"out-of-bounds-example position-right",isSearchable:!0,name:"outofboundsatright",placeholder:"Show above & to the left"}},E={args:{children:e.createElement("ul",null,e.createElement("li",null,"Antarctica"),e.createElement("li",null,"Arctic Circle"),e.createElement("li",null,"North Pole")),className:"out-of-bounds-example no-direction-change",isSearchable:!0,name:"outofboundsatbottomnodirectionchange",placeholder:"Show below even though it goes out of bounds"}};var x,b,w;n.parameters={...n.parameters,docs:{...(x=n.parameters)==null?void 0:x.docs,source:{originalSource:`{
2
- args: {
3
- children: <ul>
4
- <li>0px</li>
5
- <li>4px</li>
6
- <li>9px</li>
7
- <li>18px</li>
8
- <li>36px</li>
9
- <li>54px</li>
10
- <li>72px</li>
11
- <li>144px</li>
12
- <li>167px</li>
13
- <li>198px</li>
14
- </ul>,
15
- className: 'css-lengths no-trigger-text'
16
- }
17
- }`,...(w=(b=n.parameters)==null?void 0:b.docs)==null?void 0:w.source}}};var S,k,v;t.parameters={...t.parameters,docs:{...(S=t.parameters)==null?void 0:S.docs,source:{originalSource:`{
18
- args: {
19
- children: <ul>
20
- <li>Alabama</li>
21
- <li>Alaska</li>
22
- <li>Arizona</li>
23
- <li>Arkansas</li>
24
- <li>California</li>
25
- <li>Colorado</li>
26
- <li>Connecticut</li>
27
- <li>Delaware</li>
28
- <li>Florida</li>
29
- <li>Georgia</li>
30
- <li>Hawaii</li>
31
- <li>Idaho</li>
32
- <li>Illinois</li>
33
- <li>Indiana</li>
34
- <li>Iowa</li>
35
- <li>Kansas</li>
36
- <li>Kentucky</li>
37
- <li>Louisiana</li>
38
- <li>Maine</li>
39
- <li>Maryland</li>
40
- <li>Massachusetts</li>
41
- <li>Michigan</li>
42
- <li>Minnesota</li>
43
- <li>Mississippi</li>
44
- <li>Missouri</li>
45
- <li>Montana</li>
46
- <li>Nebraska</li>
47
- <li>Nevada</li>
48
- <li>New Hampshire</li>
49
- <li>New Jersey</li>
50
- <li>New Mexico</li>
51
- <li>New York</li>
52
- <li>North Carolina</li>
53
- <li>North Dakota</li>
54
- <li>Ohio</li>
55
- <li>Oklahoma</li>
56
- <li>Oregon</li>
57
- <li>Pennsylvania</li>
58
- <li>Rhode Island</li>
59
- <li>South Carolina</li>
60
- <li>South Dakota</li>
61
- <li>Tennessee</li>
62
- <li>Texas</li>
63
- <li>Utah</li>
64
- <li>Vermont</li>
65
- <li>Virginia</li>
66
- <li>Washington</li>
67
- <li>West Virginia</li>
68
- <li>Wisconsin</li>
69
- <li>Wyoming</li>
70
- </ul>,
71
- className: 'states-dropdown',
72
- isSearchable: true,
73
- placeholder: 'Choose a state…'
74
- }
75
- }`,...(v=(k=t.parameters)==null?void 0:k.docs)==null?void 0:v.source}}};var N,f,y;a.parameters={...a.parameters,docs:{...(N=a.parameters)==null?void 0:N.docs,source:{originalSource:`{
76
- args: {
77
- children: <ul>
78
- <li data-ukt-value="100">
79
- <span className="item-title">Font Weight - </span>
80
- 100
81
- </li>
82
- <li data-ukt-value="200">
83
- <span className="item-title">Font Weight - </span>
84
- 200
85
- </li>
86
- <li data-ukt-value="300">
87
- <span className="item-title">Font Weight - </span>
88
- 300
89
- </li>
90
- <li data-ukt-value="400">
91
- <span className="item-title">Font Weight - </span>
92
- 400
93
- </li>
94
- <li data-ukt-value="500">
95
- <span className="item-title">Font Weight - </span>
96
- 500
97
- </li>
98
- <li data-ukt-value="600">
99
- <span className="item-title">Font Weight - </span>
100
- 600
101
- </li>
102
- <li data-ukt-value="700">
103
- <span className="item-title">Font Weight - </span>
104
- 700
105
- </li>
106
- </ul>,
107
- className: 'font-weight',
108
- isSearchable: true
109
- }
110
- }`,...(y=(f=a.parameters)==null?void 0:f.docs)==null?void 0:y.source}}};var C,O,D;i.parameters={...i.parameters,docs:{...(C=i.parameters)==null?void 0:C.docs,source:{originalSource:`{
111
- args: {
112
- children: ['View menu', <Fragment>
113
- <h4 className="heading">View</h4>
114
- <ul>
115
- <li data-ukt-item>Open</li>
116
- <li data-ukt-item>Preview</li>
117
- </ul>
118
- <h4 className="heading">Edit</h4>
119
- <ul>
120
- <li data-ukt-value="save-item">Save</li>
121
- <li data-ukt-value="edit-item">Edit</li>
122
- <li data-ukt-value="delete-item">Delete</li>
123
- </ul>
124
- </Fragment>],
125
- className: 'open-on-mount-context-menu',
126
- isOpenOnMount: true,
127
- // NOTE spies are a workaround for a bug related to implicit arg detection
128
- // https://github.com/storybookjs/storybook/issues/23873
129
- onClick: fn(),
130
- onClose: fn(),
131
- onMouseDown: fn(),
132
- onMouseUp: fn(),
133
- onOpen: fn(),
134
- onSubmitItem: fn()
135
- }
136
- }`,...(D=(O=i.parameters)==null?void 0:O.docs)==null?void 0:D.source}}};var M,W,I;r.parameters={...r.parameters,docs:{...(M=r.parameters)==null?void 0:M.docs,source:{originalSource:`{
137
- args: {
138
- children: ['Open', <div>
139
- <p>
140
- Try interacting with the controls here. The dropdown should only close
141
- when you click outside of the entire dropdown or if you hit the escape
142
- key when focus isn’t in the input controls.
143
- </p>
144
- <CSSValueInput cssValueType="length" label="Width" onSubmitValue={() => {}} placeholder="100vw" unit="vw" />
145
- <CSSValueInput cssValueType="length" label="Rotation" onSubmitValue={() => {}} placeholder="0deg" step={5} unit="deg" />
146
- </div>],
147
- className: 'dropdown-without-items',
148
- hasItems: false
149
- }
150
- }`,...(I=(W=r.parameters)==null?void 0:W.docs)==null?void 0:I.source}}};var V,F,T;s.parameters={...s.parameters,docs:{...(V=s.parameters)==null?void 0:V.docs,source:{originalSource:`{
151
- args: {
152
- children: <ul>
153
- <li>0px</li>
154
- <li>4px</li>
155
- <li>9px</li>
156
- <li>18px</li>
157
- <li>36px</li>
158
- <li>54px</li>
159
- <li>72px</li>
160
- <li>144px</li>
161
- <li>167px</li>
162
- <li>198px</li>
163
- </ul>,
164
- className: 'searchable-with-label',
165
- isSearchable: true,
166
- label: 'Font size'
167
- }
168
- }`,...(T=(F=s.parameters)==null?void 0:F.docs)==null?void 0:T.source}}};var A,q,R;o.parameters={...o.parameters,docs:{...(A=o.parameters)==null?void 0:A.docs,source:{originalSource:`{
169
- args: {
170
- allowCreate: true,
171
- children: <ul>
172
- <li>0px</li>
173
- <li>4px</li>
174
- <li>9px</li>
175
- <li>18px</li>
176
- <li>36px</li>
177
- <li>54px</li>
178
- <li>72px</li>
179
- <li>144px</li>
180
- <li>167px</li>
181
- <li>198px</li>
182
- </ul>,
183
- className: 'searchable-and-allow-create',
184
- isSearchable: true,
185
- label: 'Font size'
186
- }
187
- }`,...(R=(q=o.parameters)==null?void 0:q.docs)==null?void 0:R.source}}};var z,B,L;c.parameters={...c.parameters,docs:{...(z=c.parameters)==null?void 0:z.docs,source:{originalSource:`{
188
- args: {
189
- allowCreate: true,
190
- children: [<CSSValueInput name="cssinputbackgroundsize" onSubmitValue={() => {}} placeholder="cover" validator={/^(auto|contain|cover)$/} />, <ul>
191
- <li>cover</li>
192
- <li>contain</li>
193
- <li>auto</li>
194
- <li>50px</li>
195
- <li>100px</li>
196
- <li>200px</li>
197
- <li>50%</li>
198
- </ul>],
199
- className: 'css-value-input-trigger',
200
- hasItems: true,
201
- label: 'Background size'
202
- }
203
- }`,...(L=(B=c.parameters)==null?void 0:B.docs)==null?void 0:L.source}}};var U,P,_;u.parameters={...u.parameters,docs:{...(U=u.parameters)==null?void 0:U.docs,source:{originalSource:`{
204
- args: {
205
- children: [<textarea></textarea>, <ul>
206
- <li>
207
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque
208
- ullamcorper fringilla quam, vel tincidunt nisl mattis vel.
209
- </li>
210
- <li>
211
- Aenean posuere erat sed enim luctus, et accumsan nisl elementum. Nulla
212
- vel blandit urna, vel accumsan nulla. Nulla varius luctus ex, gravida
213
- ultrices orci sagittis eu.
214
- </li>
215
- <li>
216
- Quisque vitae magna euismod ligula molestie maximus id et nunc. Nam et
217
- lacus euismod, porttitor massa vel, sollicitudin ex. Sed ut tellus
218
- suscipit, faucibus tortor nec, fermentum mi.
219
- </li>
220
- <li>
221
- Nulla sagittis justo non accumsan sagittis. Cras a eros et dolor
222
- dapibus bibendum lobortis quis ante. Ut eget scelerisque massa.
223
- </li>
224
- <li>
225
- Vestibulum quis dignissim nunc. Mauris fringilla at nulla non lacinia.
226
- Etiam tristique elit non nisl finibus, fringilla hendrerit ligula
227
- hendrerit. Fusce eget leo lacinia, eleifend diam non, suscipit purus.
228
- </li>
229
- </ul>],
230
- className: 'textarea-trigger',
231
- hasItems: true
232
- }
233
- }`,...(_=(P=u.parameters)==null?void 0:P.docs)==null?void 0:_.source}}};var K,Y,H;m.parameters={...m.parameters,docs:{...(K=m.parameters)==null?void 0:K.docs,source:{originalSource:`{
234
- args: {
235
- children: ['Colors', <ul>
236
- <li>
237
- <label>
238
- <input type="checkbox" /> Red
239
- </label>
240
- </li>
241
- <li>
242
- <label>
243
- <input type="checkbox" /> Blue
244
- </label>
245
- </li>
246
- <li>
247
- <label>
248
- <input type="checkbox" /> Yellow
249
- </label>
250
- </li>
251
- <li>
252
- <label>
253
- <input type="checkbox" /> Cyan
254
- </label>
255
- </li>
256
- <li>
257
- <label>
258
- <input type="checkbox" /> Orchid
259
- </label>
260
- </li>
261
- <li>
262
- <label>
263
- <input type="checkbox" /> Slate
264
- </label>
265
- </li>
266
- </ul>],
267
- className: 'checkboxes',
268
- keepOpenOnSubmit: true
269
- }
270
- }`,...(H=(Y=m.parameters)==null?void 0:Y.docs)==null?void 0:H.source}}};var j,G,J;p.parameters={...p.parameters,docs:{...(j=p.parameters)==null?void 0:j.docs,source:{originalSource:`{
271
- args: {
272
- children: <ul>
273
- <li>0px</li>
274
- <li>4px</li>
275
- <li>9px</li>
276
- <li>18px</li>
277
- <li>36px</li>
278
- <li>54px</li>
279
- <li>72px</li>
280
- <li>144px</li>
281
- <li>167px</li>
282
- <li>198px</li>
283
- </ul>,
284
- className: 'disabled-dropdown',
285
- disabled: true,
286
- isSearchable: true,
287
- label: 'Disabled',
288
- name: 'disabledexample',
289
- value: '167px'
290
- }
291
- }`,...(J=(G=p.parameters)==null?void 0:G.docs)==null?void 0:J.source}}};var Q,$,X;d.parameters={...d.parameters,docs:{...(Q=d.parameters)==null?void 0:Q.docs,source:{originalSource:`{
292
- args: {
293
- children: <ul>
294
- <li>the carbon in our apple pies</li>
295
- <li>sea of tranquility tesseract</li>
296
- <li>encyclopaedia galactica</li>
297
- <li>billions upon billions</li>
298
- <li>network of wormholes</li>
299
- <li>tingling of the spine</li>
300
- <li>corpus callosum</li>
301
- <li>finite but unbounded</li>
302
- </ul>,
303
- className: 'overlapping-dropdown no-trigger-text'
304
- }
305
- }`,...(X=($=d.parameters)==null?void 0:$.docs)==null?void 0:X.source}}};var Z,ee,le;h.parameters={...h.parameters,docs:{...(Z=h.parameters)==null?void 0:Z.docs,source:{originalSource:`{
306
- args: {
307
- children: <ul>
308
- <li>0px</li>
309
- <li>4px</li>
310
- <li>9px</li>
311
- <li>18px</li>
312
- <li>36px</li>
313
- <li>54px</li>
314
- <li>72px</li>
315
- <li>144px</li>
316
- <li>167px</li>
317
- <li>198px</li>
318
- </ul>,
319
- className: 'out-of-bounds-example position-right',
320
- isSearchable: true,
321
- name: 'outofboundsatright',
322
- placeholder: 'Show above & to the left'
323
- }
324
- }`,...(le=(ee=h.parameters)==null?void 0:ee.docs)==null?void 0:le.source}}};var ne,te,ae;E.parameters={...E.parameters,docs:{...(ne=E.parameters)==null?void 0:ne.docs,source:{originalSource:`{
325
- args: {
326
- children: <ul>
327
- <li>Antarctica</li>
328
- <li>Arctic Circle</li>
329
- <li>North Pole</li>
330
- </ul>,
331
- className: 'out-of-bounds-example no-direction-change',
332
- isSearchable: true,
333
- name: 'outofboundsatbottomnodirectionchange',
334
- placeholder: 'Show below even though it goes out of bounds'
335
- }
336
- }`,...(ae=(te=E.parameters)==null?void 0:te.docs)==null?void 0:ae.source}}};const ge=["CSSLengthsDropdown","StatesDropdown","FontWeightDropdown","ShowContextMenuOnMount","DropdownWithInteractiveContents","SearchableWithLabel","SearchableAndAllowCreate","CSSValueInputTrigger","TextareaTrigger","CheckboxesDropdown","DisabledDropdown","OverlappingDropdown","OutOfBoundsAtRight","OutOfBoundsWithNoDirectionChange"];export{n as CSSLengthsDropdown,c as CSSValueInputTrigger,m as CheckboxesDropdown,p as DisabledDropdown,r as DropdownWithInteractiveContents,a as FontWeightDropdown,h as OutOfBoundsAtRight,E as OutOfBoundsWithNoDirectionChange,d as OverlappingDropdown,o as SearchableAndAllowCreate,s as SearchableWithLabel,i as ShowContextMenuOnMount,t as StatesDropdown,u as TextareaTrigger,ge as __namedExportsOrder,Ee as default};
@@ -1 +0,0 @@
1
- .input-text{width:160px;padding:3px 6px;font-family:system-ui,sans-serif;font-size:13px;line-height:13px}.input-text-double-click-to-edit{border-color:transparent}.input-text-double-click-to-edit:read-only{cursor:pointer}.multi-line-input-text{width:240px}[popover]{border:0;box-shadow:0 3px 16px 1px #00000080;padding:25px 30px;border-radius:5px}
@@ -1,90 +0,0 @@
1
- import{r as t,R as rt}from"./iframe-ByGa_ItU.js";/* empty css */const{useEffect:L,useImperativeHandle:ot,useRef:M,useState:U}=rt,b=t.forwardRef(function({autoCapitalize:s,autoComplete:a,autoFocus:y,className:Oe,disabled:_e,doubleClickToEdit:p,enterKeyHint:be,form:ye,id:Pe,initialValue:P,list:xe,max:Ne,maxHeight:x=1/0,maxLength:Fe,min:Re,minLength:we,multiLine:o,multiple:Le,name:Me,onBlur:D,onChange:W,onChangeValue:V,onFocus:A,onKeyDown:B,onKeyUp:Ue,pattern:De,placeholder:We,readOnly:Ve,required:Ae,rows:Be=1,selectTextOnFocus:k,size:ke,step:Ce,style:C,submitOnEnter:He,tabIndex:Ke,title:ze,type:Ge="text"},Ye){const r=M(null);ot(Ye,()=>r.current);const[N,qe]=U(null),l=M(null),F=e=>{r.current=e,qe(e)};L(()=>{r.current&&(r.current.value=P??"")},[P]);const[m,Xe]=U(!0);L(()=>{typeof CSS>"u"||Xe(CSS.supports("field-sizing","content"))},[]);const[H,R]=U(Ve??p),w=M(!0),$e=()=>{p&&R(!1)},c=()=>{if(!r.current||m||(r.current.style.height&&(r.current.style.height=""),!o))return;const e=Math.min(r.current.scrollHeight,typeof x=="string"?parseFloat(x):x);e&&(r.current.style.height=`${e}px`)};L(()=>{if(!(!N||!o||m))return c(),l.current=new ResizeObserver(()=>c()),l.current.observe(N),()=>{l.current&&(l.current.disconnect(),l.current=null)}},[N,o,c,m]);const je=e=>{W&&W(e),V&&V(e.target.value)},Je=e=>{A&&A(e),o&&c()},Qe=e=>{D&&D(e),p&&R(!0),k&&(F(e.currentTarget),w.current=!0)},Ze=e=>{if(!k)return;const n=e.currentTarget;if(F(n),!w.current||(w.current=!1,!n.value)||n.ownerDocument.activeElement!==n)return;const K=n.value.length;n.selectionStart===0&&n.selectionEnd===K||(n.selectionStart=0,n.selectionEnd=K)},et=e=>{var n;B&&B(e),e.key==="Enter"&&(He||o&&at(e))&&(!o||!e.shiftKey&&!e.altKey&&!e.ctrlKey)?(e.preventDefault(),(n=e.currentTarget.closest("form"))==null||n.requestSubmit(),e.currentTarget.blur()):p&&r.current&&(H?e.key==="Enter"&&R(!1):(e.key==="Enter"||e.key==="Escape")&&r.current.blur())},tt=o&&m?{...C,fieldSizing:"content"}:C,nt=o?"textarea":"input";return t.createElement(nt,{autoCapitalize:s,autoComplete:a,autoFocus:y,className:Oe,defaultValue:P??"",disabled:_e,enterKeyHint:be,form:ye,id:Pe,list:xe,maxLength:Fe,minLength:we,multiple:Le,name:Me,onBlur:Qe,onChange:je,onDoubleClick:$e,onFocus:Je,onKeyDown:et,onKeyUp:Ue,onSelect:Ze,pattern:De,placeholder:We,readOnly:H,ref:F,required:Ae,size:ke,style:tt,tabIndex:Ke,title:ze,type:Ge,...o?{onInput:c,rows:Be}:{max:Ne,min:Re,step:Ce}})}),it=/mac|iphone|ipad|ipod/i;function at(i){var a;const s=((a=globalThis.navigator)==null?void 0:a.platform)??"";return it.test(s)?i.metaKey:i.ctrlKey}const{fn:u}=__STORYBOOK_MODULE_TEST__,ct={component:b,parameters:{docs:{description:{component:'`InputText` is a React component that renders a textual input (`type: "text"|"email"|"number"|"password"|"search"|"tel"|"url"`) that is uncontrolled, but whose value is overwritten whenever `props.initialValue` changes. Also, if `props.selectTextOnFocus` is true, it selects the entire contents of the input whenever the input is focused. And it supports multiline inputs (rendered as a `<textarea>`) that automatically resize vertically to fit their content.'}}},tags:["autodocs"],title:"UIKit/Controls/InputText"},d={args:{className:"input-text",name:"empty",onBlur:u(),onChange:u(),onChangeValue:u(),onFocus:u(),onKeyDown:u(),onKeyUp:u(),placeholder:"enter text here…"}},h={args:{className:"input-text",initialValue:"Bolivia",placeholder:"enter country name"}},f={args:{className:"input-text",initialValue:"Bolivia",name:"country",placeholder:"enter country name (selectTextOnFocus)",selectTextOnFocus:!0}},g={args:{className:"multi-line-input-text",initialValue:"The Black Hawk War, or, How to Demolish an Entire Civilization and Still Feel Good About Yourself in the Morning, or, We Apologize for the Inconvenience but You’re Going to Have to Leave Now, or, “I have fought the Big Knives and will continue to fight them until they are off our lands!”",maxHeight:600,multiLine:!0,name:"multi-line-input",placeholder:"enter text of any length",selectTextOnFocus:!0}},_={className:"multi-line-input-text",maxHeight:600,multiLine:!0,name:"multi-line-submit-on-enter-input",placeholder:"enter text of any length",submitOnEnter:!0},ut=new Intl.DateTimeFormat(void 0,{timeStyle:"medium"}).format,I={args:_,render(){const[i,s]=t.useState(null),a=i?ut(i):"never";return t.createElement("form",{onSubmit:y=>{y.preventDefault(),s(new Date)}},t.createElement(b,{..._}),t.createElement("pre",null,"Last submitted: ",a))}},S={args:{..._,name:_.name+"-no-form"}},T={args:{className:"input-text-double-click-to-edit",doubleClickToEdit:!0,initialValue:"Lorem ipsum dolor sit amet",name:"double-click-to-edit-input"}},v={args:{autoFocus:!0,name:"autofocus-input"}},z={className:"multi-line-input-text",initialValue:"This multi-line input should resize to fit its contents when the popover opens even though it initializes with display: none as a result of being inside a hidden popover element so it doesn’t have any dimensions when the component initially renders.",multiLine:!0,name:"multi-line-input-in-popover",selectTextOnFocus:!0},E={args:z,render(){return t.createElement(t.Fragment,null,t.createElement("button",{popoverTarget:"multi-line-input-popover"},"Open Popover"),t.createElement("div",{id:"multi-line-input-popover",popover:"auto"},t.createElement(b,{...z})))}},G={autoFocus:!0,initialValue:"This multi-line input should be focused when the popover opens",multiLine:!0,name:"multi-line-input-with-autofocus-in-popover",selectTextOnFocus:!0},O={args:G,render(){return t.createElement(t.Fragment,null,t.createElement("button",{popoverTarget:"multi-line-input-with-autofocus-popover"},"Open Popover"),t.createElement("div",{id:"multi-line-input-with-autofocus-popover",popover:"auto"},t.createElement(b,{...G})))}};var Y,q,X;d.parameters={...d.parameters,docs:{...(Y=d.parameters)==null?void 0:Y.docs,source:{originalSource:`{
2
- args: {
3
- className: 'input-text',
4
- name: 'empty',
5
- // NOTE spies are a workaround for a bug related to implicit arg detection
6
- onBlur: fn(),
7
- onChange: fn(),
8
- onChangeValue: fn(),
9
- onFocus: fn(),
10
- onKeyDown: fn(),
11
- onKeyUp: fn(),
12
- placeholder: 'enter text here…'
13
- }
14
- }`,...(X=(q=d.parameters)==null?void 0:q.docs)==null?void 0:X.source}}};var $,j,J;h.parameters={...h.parameters,docs:{...($=h.parameters)==null?void 0:$.docs,source:{originalSource:`{
15
- args: {
16
- className: 'input-text',
17
- initialValue: 'Bolivia',
18
- placeholder: 'enter country name'
19
- }
20
- }`,...(J=(j=h.parameters)==null?void 0:j.docs)==null?void 0:J.source}}};var Q,Z,ee;f.parameters={...f.parameters,docs:{...(Q=f.parameters)==null?void 0:Q.docs,source:{originalSource:`{
21
- args: {
22
- className: 'input-text',
23
- initialValue: 'Bolivia',
24
- name: 'country',
25
- placeholder: 'enter country name (selectTextOnFocus)',
26
- selectTextOnFocus: true
27
- }
28
- }`,...(ee=(Z=f.parameters)==null?void 0:Z.docs)==null?void 0:ee.source}}};var te,ne,re;g.parameters={...g.parameters,docs:{...(te=g.parameters)==null?void 0:te.docs,source:{originalSource:`{
29
- args: {
30
- className: 'multi-line-input-text',
31
- initialValue: 'The Black Hawk War, or, How to Demolish an Entire Civilization and Still Feel Good About Yourself in the Morning, or, We Apologize for the Inconvenience but You’re Going to Have to Leave Now, or, “I have fought the Big Knives and will continue to fight them until they are off our lands!”',
32
- maxHeight: 600,
33
- multiLine: true,
34
- name: 'multi-line-input',
35
- placeholder: 'enter text of any length',
36
- selectTextOnFocus: true
37
- }
38
- }`,...(re=(ne=g.parameters)==null?void 0:ne.docs)==null?void 0:re.source}}};var oe,ie,ae;I.parameters={...I.parameters,docs:{...(oe=I.parameters)==null?void 0:oe.docs,source:{originalSource:`{
39
- args: SUBMIT_ON_ENTER_PROPS,
40
- render() {
41
- const [lastSubmitDate, setLastSubmitDate] = React.useState<Date | null>(null);
42
- const lastSubmit = lastSubmitDate ? formatDate(lastSubmitDate) : 'never';
43
- return <form onSubmit={(event: React.FormEvent<HTMLFormElement>) => {
44
- event.preventDefault();
45
- setLastSubmitDate(new Date());
46
- }}>
47
- <InputText {...SUBMIT_ON_ENTER_PROPS} />
48
- <pre>Last submitted: {lastSubmit}</pre>
49
- </form>;
50
- }
51
- }`,...(ae=(ie=I.parameters)==null?void 0:ie.docs)==null?void 0:ae.source}}};var ue,se,le;S.parameters={...S.parameters,docs:{...(ue=S.parameters)==null?void 0:ue.docs,source:{originalSource:`{
52
- args: {
53
- ...SUBMIT_ON_ENTER_PROPS,
54
- name: SUBMIT_ON_ENTER_PROPS.name + '-no-form'
55
- }
56
- }`,...(le=(se=S.parameters)==null?void 0:se.docs)==null?void 0:le.source}}};var ce,pe,me;T.parameters={...T.parameters,docs:{...(ce=T.parameters)==null?void 0:ce.docs,source:{originalSource:`{
57
- args: {
58
- className: 'input-text-double-click-to-edit',
59
- doubleClickToEdit: true,
60
- initialValue: 'Lorem ipsum dolor sit amet',
61
- name: 'double-click-to-edit-input'
62
- }
63
- }`,...(me=(pe=T.parameters)==null?void 0:pe.docs)==null?void 0:me.source}}};var de,he,fe;v.parameters={...v.parameters,docs:{...(de=v.parameters)==null?void 0:de.docs,source:{originalSource:`{
64
- args: {
65
- autoFocus: true,
66
- name: 'autofocus-input'
67
- }
68
- }`,...(fe=(he=v.parameters)==null?void 0:he.docs)==null?void 0:fe.source}}};var ge,Ie,Se;E.parameters={...E.parameters,docs:{...(ge=E.parameters)==null?void 0:ge.docs,source:{originalSource:`{
69
- args: MULTI_LINE_INPUT_IN_POPOVER_PROPS,
70
- render() {
71
- return <>
72
- <button popoverTarget="multi-line-input-popover">Open Popover</button>
73
- <div id="multi-line-input-popover" popover="auto">
74
- <InputText {...MULTI_LINE_INPUT_IN_POPOVER_PROPS} />
75
- </div>
76
- </>;
77
- }
78
- }`,...(Se=(Ie=E.parameters)==null?void 0:Ie.docs)==null?void 0:Se.source}}};var Te,ve,Ee;O.parameters={...O.parameters,docs:{...(Te=O.parameters)==null?void 0:Te.docs,source:{originalSource:`{
79
- args: MULTI_LINE_INPUT_WITH_AUTO_FOCUS_PROPS,
80
- render() {
81
- return <>
82
- <button popoverTarget="multi-line-input-with-autofocus-popover">
83
- Open Popover
84
- </button>
85
- <div id="multi-line-input-with-autofocus-popover" popover="auto">
86
- <InputText {...MULTI_LINE_INPUT_WITH_AUTO_FOCUS_PROPS} />
87
- </div>
88
- </>;
89
- }
90
- }`,...(Ee=(ve=O.parameters)==null?void 0:ve.docs)==null?void 0:Ee.source}}};const pt=["EmptyInput","InputWithInitialValue","InputWithInitialValueAndSelectTextOnFocus","MultiLineInputWithInitialValueAndSelectTextOnFocus","MultiLineInputWithSubmitOnEnter","MultiLineInputWithSubmitOnEnterNoForm","InputWithDoubleClickToEdit","InputWithAutoFocus","MultiLineInputInPopover","MultiLineInputWithAutoFocusInPopover"];export{d as EmptyInput,v as InputWithAutoFocus,T as InputWithDoubleClickToEdit,h as InputWithInitialValue,f as InputWithInitialValueAndSelectTextOnFocus,E as MultiLineInputInPopover,O as MultiLineInputWithAutoFocusInPopover,g as MultiLineInputWithInitialValueAndSelectTextOnFocus,I as MultiLineInputWithSubmitOnEnter,S as MultiLineInputWithSubmitOnEnterNoForm,pt as __namedExportsOrder,ct as default};