@dktunited-techoff/techoff-suite-ui 1.8.9 → 1.9.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.
- package/esm/components/TsIcon/icons/index.js +1 -0
- package/esm/components/TsIcon/icons/index.js.map +1 -1
- package/esm/components/TsIcon/icons/index.ts +1 -0
- package/esm/components/TsIcon/icons/t-shirt.svg +1 -0
- package/esm/components/TsLoader/TsLoader.js +2 -0
- package/esm/components/TsLoader/TsLoader.js.map +1 -1
- package/esm/components/TsSwitcher/TsSwitcher.css +35 -0
- package/esm/components/TsSwitcher/TsSwitcher.d.ts +4 -0
- package/esm/components/TsSwitcher/TsSwitcher.js +20 -0
- package/esm/components/TsSwitcher/TsSwitcher.js.map +1 -0
- package/esm/components/TsSwitcher/TsSwitcher.types.d.ts +10 -0
- package/esm/components/TsSwitcher/TsSwitcher.types.js +2 -0
- package/esm/components/TsSwitcher/TsSwitcher.types.js.map +1 -0
- package/esm/components/TsSwitcher/__stories__/TsSwitcher.stories.mdx +34 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.js +1 -0
- package/esm/index.js.map +1 -1
- package/lib/components/TsIcon/icons/index.js +1 -0
- package/lib/components/TsIcon/icons/index.js.map +1 -1
- package/lib/components/TsIcon/icons/index.ts +1 -0
- package/lib/components/TsIcon/icons/t-shirt.svg +1 -0
- package/lib/components/TsLoader/TsLoader.js +2 -0
- package/lib/components/TsLoader/TsLoader.js.map +1 -1
- package/lib/components/TsSwitcher/TsSwitcher.css +35 -0
- package/lib/components/TsSwitcher/TsSwitcher.d.ts +4 -0
- package/lib/components/TsSwitcher/TsSwitcher.js +24 -0
- package/lib/components/TsSwitcher/TsSwitcher.js.map +1 -0
- package/lib/components/TsSwitcher/TsSwitcher.types.d.ts +10 -0
- package/lib/components/TsSwitcher/TsSwitcher.types.js +3 -0
- package/lib/components/TsSwitcher/TsSwitcher.types.js.map +1 -0
- package/lib/components/TsSwitcher/__stories__/TsSwitcher.stories.mdx +34 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/TsIcon/icons/index.ts +1 -0
- package/src/components/TsIcon/icons/t-shirt.svg +1 -0
- package/src/components/TsLoader/TsLoader.tsx +2 -0
- package/src/components/TsSwitcher/TsSwitcher.css +35 -0
- package/src/components/TsSwitcher/TsSwitcher.tsx +37 -0
- package/src/components/TsSwitcher/TsSwitcher.types.ts +2 -0
- package/src/components/TsSwitcher/__stories__/TsSwitcher.stories.mdx +34 -0
- package/src/index.ts +1 -0
|
@@ -57,6 +57,7 @@ export const icons = {
|
|
|
57
57
|
'search': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"></path></svg>',
|
|
58
58
|
'seedling-circle': '<svg version="1.1" id="Calque_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 18 18" style="enable-background:new 0 0 18 18;" xml:space="preserve"><path d="M9,18c-5,0-9-4-9-9s4-9,9-9s9,4,9,9S14,18,9,18z M9,16.2c4,0,7.2-3.2,7.2-7.2S13,1.8,9,1.8S1.8,5,1.8,9S5,16.2,9,16.2z"/><g> <g> <path d="M8.5,11.1C8,9.1,6.9,8.4,4.7,8.7c0,0,0,0-0.1,0c0,0,0,0-0.1,0c0,0,0,0,0,0.1c0,0,0,0,0,0.1C4.6,9.5,5.2,11.5,8.5,11.1z"/> <path d="M9.2,9.6c2-2.7,1.8-4.5-0.9-6.8c0,0-0.1,0-0.2,0C8,2.8,8,2.8,7.9,2.9C7.2,3.6,5.3,6.2,9.2,9.6"/> <path d="M13.3,9.5C13.3,9.5,13.4,9.5,13.3,9.5c0.1,0,0.1,0.1,0.2,0.1v0.1v0.1c-0.1,0.8-0.6,3-4.1,3.1c-0.2,0.5-0.2,1.1,0,1.6 l-0.9,0.3c-0.2-0.9-0.2-1.8,0-2.7C8.7,11.5,9,11,9.4,10.6s0.9-0.7,1.5-0.9C11.7,9.5,12.5,9.4,13.3,9.5"/> </g></g></svg>',
|
|
59
59
|
'square': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM5 5V19H19V5H5Z"></path></svg>',
|
|
60
|
+
't-shirt': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M8.99805 3C8.99805 4.65685 10.3412 6 11.998 6C13.6549 6 14.998 4.65685 14.998 3H20.998C21.5503 3 21.998 3.44772 21.998 4V11C21.998 11.5523 21.5503 12 20.998 12H18.997L18.998 20C18.998 20.5523 18.5503 21 17.998 21H5.99805C5.44576 21 4.99805 20.5523 4.99805 20L4.99705 11.999L2.99805 12C2.44576 12 1.99805 11.5523 1.99805 11V4C1.99805 3.44772 2.44576 3 2.99805 3H8.99805ZM19.998 4.999H16.581L16.5642 5.04018C15.8115 6.7223 14.1566 7.91251 12.2149 7.99538L11.998 8C9.96331 8 8.21245 6.7846 7.43186 5.04018L7.41405 4.999H3.99805V9.999L6.9968 9.998L6.99705 19H16.998L16.9968 10L19.998 9.999V4.999Z"></path></svg>',
|
|
60
61
|
'timer': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M17.6177 5.9681L19.0711 4.51472L20.4853 5.92893L19.0319 7.38231C20.2635 8.92199 21 10.875 21 13C21 17.9706 16.9706 22 12 22C7.02944 22 3 17.9706 3 13C3 8.02944 7.02944 4 12 4C14.125 4 16.078 4.73647 17.6177 5.9681ZM12 20C15.866 20 19 16.866 19 13C19 9.13401 15.866 6 12 6C8.13401 6 5 9.13401 5 13C5 16.866 8.13401 20 12 20ZM11 8H13V14H11V8ZM8 1H16V3H8V1Z"></path></svg>',
|
|
61
62
|
'tools': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5.32943 3.27152C6.56252 2.83314 7.9923 3.10743 8.97927 4.0944C10.1002 5.21531 10.3019 6.90735 9.5843 8.23378L20.293 18.9436L18.8788 20.3579L8.16982 9.64869C6.84325 10.3668 5.15069 10.1653 4.02952 9.04415C3.04227 8.0569 2.7681 6.62659 3.20701 5.39326L5.44373 7.62994C6.02952 8.21572 6.97927 8.21572 7.56505 7.62994C8.15084 7.04415 8.15084 6.0944 7.56505 5.50862L5.32943 3.27152ZM15.6968 5.15506L18.8788 3.38729L20.293 4.80151L18.5252 7.98349L16.7574 8.33704L14.6361 10.4584L13.2219 9.04415L15.3432 6.92283L15.6968 5.15506ZM8.97927 13.2868L10.3935 14.701L5.09018 20.0043C4.69966 20.3948 4.06649 20.3948 3.67597 20.0043C3.31334 19.6417 3.28744 19.0698 3.59826 18.6773L3.67597 18.5901L8.97927 13.2868Z"></path></svg>',
|
|
62
63
|
'user': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4 22C4 17.5817 7.58172 14 12 14C16.4183 14 20 17.5817 20 22H18C18 18.6863 15.3137 16 12 16C8.68629 16 6 18.6863 6 22H4ZM12 13C8.685 13 6 10.315 6 7C6 3.685 8.685 1 12 1C15.315 1 18 3.685 18 7C18 10.315 15.315 13 12 13ZM12 11C14.21 11 16 9.21 16 7C16 4.79 14.21 3 12 3C9.79 3 8 4.79 8 7C8 9.21 9.79 11 12 11Z"></path></svg>',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/TsIcon/icons/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAA4B;IAC5C,YAAY,EAAE,qXAAqX;IACnY,KAAK,EAAE,mJAAmJ;IAC1J,qBAAqB,EAAE,+PAA+P;IACtR,cAAc,EAAE,gXAAgX;IAChY,uBAAuB,EAAE,giBAAgiB;IACzjB,gBAAgB,EAAE,ylBAAylB;IAC3mB,yBAAyB,EAAE,oSAAoS;IAC/T,uBAAuB,EAAE,2PAA2P;IACpR,YAAY,EAAE,wOAAwO;IACtP,eAAe,EAAE,oYAAoY;IACrZ,kBAAkB,EAAE,yXAAyX;IAC7Y,YAAY,EAAE,uOAAuO;IACrP,aAAa,EAAE,uOAAuO;IACtP,eAAe,EAAE,+WAA+W;IAChY,UAAU,EAAE,wOAAwO;IACpP,OAAO,EAAE,iqBAAiqB;IAC1qB,qBAAqB,EAAE,kUAAkU;IACzV,oBAAoB,EAAE,ikBAAikB;IACvlB,cAAc,EAAE,mbAAmb;IACnc,qBAAqB,EAAE,wUAAwU;IAC/V,cAAc,EAAE,uVAAuV;IACvW,OAAO,EAAE,wNAAwN;IACjO,cAAc,EAAE,0NAA0N;IAC1O,cAAc,EAAE,mNAAmN;IACnO,eAAe,EAAE,2NAA2N;IAC5O,YAAY,EAAE,kNAAkN;IAChO,QAAQ,EAAE,4UAA4U;IACtV,cAAc,EAAE,ogBAAogB;IACphB,OAAO,EAAE,2TAA2T;IACpU,eAAe,EAAE,oWAAoW;IACrX,YAAY,EAAE,gPAAgP;IAC9P,UAAU,EAAE,mOAAmO;IAC/O,MAAM,EAAE,iXAAiX;IACzX,eAAe,EAAE,oSAAoS;IACrT,YAAY,EAAE,icAAic;IAC/c,QAAQ,EAAE,sMAAsM;IAChN,gBAAgB,EAAE,yZAAyZ;IAC3a,YAAY,EAAE,0UAA0U;IAC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AAQ,EAAE,gPAAgP;IAC1P,SAAS,EAAE,0rBAA0rB;IACrsB,OAAO,EAAE,4cAA4c;IACrd,OAAO,EAAE,oyBAAoyB;IAC7yB,MAAM,EAAE,8ZAA8Z;CACva,CAAC"}
|
|
@@ -57,6 +57,7 @@ export const icons: { [k: string]: string } = {
|
|
|
57
57
|
'search': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"></path></svg>',
|
|
58
58
|
'seedling-circle': '<svg version="1.1" id="Calque_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 18 18" style="enable-background:new 0 0 18 18;" xml:space="preserve"><path d="M9,18c-5,0-9-4-9-9s4-9,9-9s9,4,9,9S14,18,9,18z M9,16.2c4,0,7.2-3.2,7.2-7.2S13,1.8,9,1.8S1.8,5,1.8,9S5,16.2,9,16.2z"/><g> <g> <path d="M8.5,11.1C8,9.1,6.9,8.4,4.7,8.7c0,0,0,0-0.1,0c0,0,0,0-0.1,0c0,0,0,0,0,0.1c0,0,0,0,0,0.1C4.6,9.5,5.2,11.5,8.5,11.1z"/> <path d="M9.2,9.6c2-2.7,1.8-4.5-0.9-6.8c0,0-0.1,0-0.2,0C8,2.8,8,2.8,7.9,2.9C7.2,3.6,5.3,6.2,9.2,9.6"/> <path d="M13.3,9.5C13.3,9.5,13.4,9.5,13.3,9.5c0.1,0,0.1,0.1,0.2,0.1v0.1v0.1c-0.1,0.8-0.6,3-4.1,3.1c-0.2,0.5-0.2,1.1,0,1.6 l-0.9,0.3c-0.2-0.9-0.2-1.8,0-2.7C8.7,11.5,9,11,9.4,10.6s0.9-0.7,1.5-0.9C11.7,9.5,12.5,9.4,13.3,9.5"/> </g></g></svg>',
|
|
59
59
|
'square': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM5 5V19H19V5H5Z"></path></svg>',
|
|
60
|
+
't-shirt': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M8.99805 3C8.99805 4.65685 10.3412 6 11.998 6C13.6549 6 14.998 4.65685 14.998 3H20.998C21.5503 3 21.998 3.44772 21.998 4V11C21.998 11.5523 21.5503 12 20.998 12H18.997L18.998 20C18.998 20.5523 18.5503 21 17.998 21H5.99805C5.44576 21 4.99805 20.5523 4.99805 20L4.99705 11.999L2.99805 12C2.44576 12 1.99805 11.5523 1.99805 11V4C1.99805 3.44772 2.44576 3 2.99805 3H8.99805ZM19.998 4.999H16.581L16.5642 5.04018C15.8115 6.7223 14.1566 7.91251 12.2149 7.99538L11.998 8C9.96331 8 8.21245 6.7846 7.43186 5.04018L7.41405 4.999H3.99805V9.999L6.9968 9.998L6.99705 19H16.998L16.9968 10L19.998 9.999V4.999Z"></path></svg>',
|
|
60
61
|
'timer': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M17.6177 5.9681L19.0711 4.51472L20.4853 5.92893L19.0319 7.38231C20.2635 8.92199 21 10.875 21 13C21 17.9706 16.9706 22 12 22C7.02944 22 3 17.9706 3 13C3 8.02944 7.02944 4 12 4C14.125 4 16.078 4.73647 17.6177 5.9681ZM12 20C15.866 20 19 16.866 19 13C19 9.13401 15.866 6 12 6C8.13401 6 5 9.13401 5 13C5 16.866 8.13401 20 12 20ZM11 8H13V14H11V8ZM8 1H16V3H8V1Z"></path></svg>',
|
|
61
62
|
'tools': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5.32943 3.27152C6.56252 2.83314 7.9923 3.10743 8.97927 4.0944C10.1002 5.21531 10.3019 6.90735 9.5843 8.23378L20.293 18.9436L18.8788 20.3579L8.16982 9.64869C6.84325 10.3668 5.15069 10.1653 4.02952 9.04415C3.04227 8.0569 2.7681 6.62659 3.20701 5.39326L5.44373 7.62994C6.02952 8.21572 6.97927 8.21572 7.56505 7.62994C8.15084 7.04415 8.15084 6.0944 7.56505 5.50862L5.32943 3.27152ZM15.6968 5.15506L18.8788 3.38729L20.293 4.80151L18.5252 7.98349L16.7574 8.33704L14.6361 10.4584L13.2219 9.04415L15.3432 6.92283L15.6968 5.15506ZM8.97927 13.2868L10.3935 14.701L5.09018 20.0043C4.69966 20.3948 4.06649 20.3948 3.67597 20.0043C3.31334 19.6417 3.28744 19.0698 3.59826 18.6773L3.67597 18.5901L8.97927 13.2868Z"></path></svg>',
|
|
62
63
|
'user': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4 22C4 17.5817 7.58172 14 12 14C16.4183 14 20 17.5817 20 22H18C18 18.6863 15.3137 16 12 16C8.68629 16 6 18.6863 6 22H4ZM12 13C8.685 13 6 10.315 6 7C6 3.685 8.685 1 12 1C15.315 1 18 3.685 18 7C18 10.315 15.315 13 12 13ZM12 11C14.21 11 16 9.21 16 7C16 4.79 14.21 3 12 3C9.79 3 8 4.79 8 7C8 9.21 9.79 11 12 11Z"></path></svg>',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M8.99805 3C8.99805 4.65685 10.3412 6 11.998 6C13.6549 6 14.998 4.65685 14.998 3H20.998C21.5503 3 21.998 3.44772 21.998 4V11C21.998 11.5523 21.5503 12 20.998 12H18.997L18.998 20C18.998 20.5523 18.5503 21 17.998 21H5.99805C5.44576 21 4.99805 20.5523 4.99805 20L4.99705 11.999L2.99805 12C2.44576 12 1.99805 11.5523 1.99805 11V4C1.99805 3.44772 2.44576 3 2.99805 3H8.99805ZM19.998 4.999H16.581L16.5642 5.04018C15.8115 6.7223 14.1566 7.91251 12.2149 7.99538L11.998 8C9.96331 8 8.21245 6.7846 7.43186 5.04018L7.41405 4.999H3.99805V9.999L6.9968 9.998L6.99705 19H16.998L16.9968 10L19.998 9.999V4.999Z"></path></svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TsLoader.js","sourceRoot":"","sources":["../../../src/components/TsLoader/TsLoader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,gBAAgB,CAAC;AAExB,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EAAE,IAAI,GAAG,IAAI,EAAiB,EAAE,EAAE;IACzD,OAAO,6BAAK,SAAS,EAAE,wBAAwB,IAAI,EAAE,GAAI,CAAC;AAC5D,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"TsLoader.js","sourceRoot":"","sources":["../../../src/components/TsLoader/TsLoader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,gBAAgB,CAAC;AAExB,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EAAE,IAAI,GAAG,IAAI,EAAiB,EAAE,EAAE;IACzD,YAAY;IACZ,YAAY;IACZ,OAAO,6BAAK,SAAS,EAAE,wBAAwB,IAAI,EAAE,GAAI,CAAC;AAC5D,CAAC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.ts-content-switcher {
|
|
2
|
+
display: flex;
|
|
3
|
+
width: 100%;
|
|
4
|
+
}
|
|
5
|
+
.ts-content-switcher > div {
|
|
6
|
+
margin-right: 8px;
|
|
7
|
+
}
|
|
8
|
+
.ts-switcher {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
height: 44px;
|
|
12
|
+
padding: 0 16px;
|
|
13
|
+
background: #ebecf7;
|
|
14
|
+
color: #3643ba;
|
|
15
|
+
font-weight: 600;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
transition: all ease 0.3s;
|
|
18
|
+
}
|
|
19
|
+
.ts-switcher--selected {
|
|
20
|
+
background: #3643ba;
|
|
21
|
+
color: #ffffff;
|
|
22
|
+
}
|
|
23
|
+
.ts-switcher-icon {
|
|
24
|
+
margin-right: 8px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* ######### */
|
|
28
|
+
/* GLOBALS */
|
|
29
|
+
* {
|
|
30
|
+
font-size: 14px;
|
|
31
|
+
outline: none;
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
|
|
34
|
+
'Helvetica Neue', sans-serif;
|
|
35
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { TsIcon } from '../TsIcon/TsIcon';
|
|
4
|
+
import './TsSwitcher.css';
|
|
5
|
+
export const TsSwitcher = ({ defaultSwitch, switchs, onChange }) => {
|
|
6
|
+
const [selectedSwitch, setSelectedSwitch] = useState(defaultSwitch ?? '');
|
|
7
|
+
// ########
|
|
8
|
+
// Handlers
|
|
9
|
+
const handleChange = (val) => {
|
|
10
|
+
setSelectedSwitch(val);
|
|
11
|
+
onChange(val);
|
|
12
|
+
};
|
|
13
|
+
// #########
|
|
14
|
+
// Rendering
|
|
15
|
+
return (React.createElement("div", { className: "ts-content-switcher" }, switchs.map(s => (React.createElement("div", { key: s.value, className: `ts-switcher ${selectedSwitch === s.value ? 'ts-switcher--selected' : ''}`, onClick: () => handleChange(s.value) },
|
|
16
|
+
s.icon && (React.createElement("div", { className: "ts-switcher-icon" },
|
|
17
|
+
React.createElement(TsIcon, { name: s.icon }))),
|
|
18
|
+
React.createElement("div", { className: "ts-switcher-label" }, s.label))))));
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=TsSwitcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TsSwitcher.js","sourceRoot":"","sources":["../../../src/components/TsSwitcher/TsSwitcher.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,kBAAkB,CAAC;AAE1B,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAmB,EAAE,EAAE;IAClF,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAS,aAAa,IAAI,EAAE,CAAC,CAAC;IAElF,WAAW;IACX,WAAW;IACX,MAAM,YAAY,GAAG,CAAC,GAAW,EAAE,EAAE;QACnC,iBAAiB,CAAC,GAAG,CAAC,CAAC;QACvB,QAAQ,CAAC,GAAG,CAAC,CAAC;IAChB,CAAC,CAAC;IAEF,YAAY;IACZ,YAAY;IACZ,OAAO,CACL,6BAAK,SAAS,EAAC,qBAAqB,IACjC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAChB,6BACE,GAAG,EAAE,CAAC,CAAC,KAAK,EACZ,SAAS,EAAE,eAAe,cAAc,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,EAAE,EACrF,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC;QAEnC,CAAC,CAAC,IAAI,IAAI,CACT,6BAAK,SAAS,EAAC,kBAAkB;YAC/B,oBAAC,MAAM,IAAC,IAAI,EAAE,CAAC,CAAC,IAAI,GAAI,CACpB,CACP;QACD,6BAAK,SAAS,EAAC,mBAAmB,IAAE,CAAC,CAAC,KAAK,CAAO,CAC9C,CACP,CAAC,CACE,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TsSwitcher.types.js","sourceRoot":"","sources":["../../../src/components/TsSwitcher/TsSwitcher.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ArgsTable, Canvas, Meta, Story } from '@storybook/blocks';
|
|
3
|
+
import { icons } from '../../TsIcon/icons';
|
|
4
|
+
import { TsSwitcher } from '../TsSwitcher';
|
|
5
|
+
|
|
6
|
+
<Meta title="Components/Switcher" />
|
|
7
|
+
|
|
8
|
+
export const switcherArgTypes = {};
|
|
9
|
+
|
|
10
|
+
# Switcher
|
|
11
|
+
|
|
12
|
+
Content switchers allow users to toggle between two or more content sections within the same space on the screen.
|
|
13
|
+
|
|
14
|
+
## Overview
|
|
15
|
+
|
|
16
|
+
<Canvas>
|
|
17
|
+
<Story
|
|
18
|
+
name="Overview"
|
|
19
|
+
args={{
|
|
20
|
+
switchs: [
|
|
21
|
+
{ icon: 'check', label: 'Section 1', value: 'section-1' },
|
|
22
|
+
{ icon: 'delete-bin', label: 'Section 2', value: 'section-2' },
|
|
23
|
+
],
|
|
24
|
+
onChange: () => {},
|
|
25
|
+
}}
|
|
26
|
+
argTypes={switcherArgTypes}
|
|
27
|
+
>
|
|
28
|
+
{args => <TsSwitcher {...args} />}
|
|
29
|
+
</Story>
|
|
30
|
+
</Canvas>
|
|
31
|
+
|
|
32
|
+
## Props
|
|
33
|
+
|
|
34
|
+
<ArgsTable story="Overview" of={TsSwitcher} />
|
package/esm/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from './components/TsIcon/TsIcon';
|
|
|
6
6
|
export * from './components/TsInput/TsBooleanInput/TsBooleanInput';
|
|
7
7
|
export * from './components/TsInput/TsInput/TsInput';
|
|
8
8
|
export * from './components/TsLoader/TsLoader';
|
|
9
|
+
export * from './components/TsSwitcher/TsSwitcher';
|
|
9
10
|
export * from './components/TsTabs/TsTabs';
|
|
10
11
|
export * from './layouts/TsHeader/TsHeader';
|
|
11
12
|
export * from './layouts/TsHeader/TsHeaderProfile';
|
package/esm/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export * from './components/TsIcon/TsIcon';
|
|
|
6
6
|
export * from './components/TsInput/TsBooleanInput/TsBooleanInput';
|
|
7
7
|
export * from './components/TsInput/TsInput/TsInput';
|
|
8
8
|
export * from './components/TsLoader/TsLoader';
|
|
9
|
+
export * from './components/TsSwitcher/TsSwitcher';
|
|
9
10
|
export * from './components/TsTabs/TsTabs';
|
|
10
11
|
export * from './layouts/TsHeader/TsHeader';
|
|
11
12
|
export * from './layouts/TsHeader/TsHeaderProfile';
|
package/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4DAA4D,CAAC;AAC3E,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oDAAoD,CAAC;AACnE,cAAc,sCAAsC,CAAC;AACrD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4DAA4D,CAAC;AAC3E,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oDAAoD,CAAC;AACnE,cAAc,sCAAsC,CAAC;AACrD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC"}
|
|
@@ -60,6 +60,7 @@ exports.icons = {
|
|
|
60
60
|
'search': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"></path></svg>',
|
|
61
61
|
'seedling-circle': '<svg version="1.1" id="Calque_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 18 18" style="enable-background:new 0 0 18 18;" xml:space="preserve"><path d="M9,18c-5,0-9-4-9-9s4-9,9-9s9,4,9,9S14,18,9,18z M9,16.2c4,0,7.2-3.2,7.2-7.2S13,1.8,9,1.8S1.8,5,1.8,9S5,16.2,9,16.2z"/><g> <g> <path d="M8.5,11.1C8,9.1,6.9,8.4,4.7,8.7c0,0,0,0-0.1,0c0,0,0,0-0.1,0c0,0,0,0,0,0.1c0,0,0,0,0,0.1C4.6,9.5,5.2,11.5,8.5,11.1z"/> <path d="M9.2,9.6c2-2.7,1.8-4.5-0.9-6.8c0,0-0.1,0-0.2,0C8,2.8,8,2.8,7.9,2.9C7.2,3.6,5.3,6.2,9.2,9.6"/> <path d="M13.3,9.5C13.3,9.5,13.4,9.5,13.3,9.5c0.1,0,0.1,0.1,0.2,0.1v0.1v0.1c-0.1,0.8-0.6,3-4.1,3.1c-0.2,0.5-0.2,1.1,0,1.6 l-0.9,0.3c-0.2-0.9-0.2-1.8,0-2.7C8.7,11.5,9,11,9.4,10.6s0.9-0.7,1.5-0.9C11.7,9.5,12.5,9.4,13.3,9.5"/> </g></g></svg>',
|
|
62
62
|
'square': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM5 5V19H19V5H5Z"></path></svg>',
|
|
63
|
+
't-shirt': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M8.99805 3C8.99805 4.65685 10.3412 6 11.998 6C13.6549 6 14.998 4.65685 14.998 3H20.998C21.5503 3 21.998 3.44772 21.998 4V11C21.998 11.5523 21.5503 12 20.998 12H18.997L18.998 20C18.998 20.5523 18.5503 21 17.998 21H5.99805C5.44576 21 4.99805 20.5523 4.99805 20L4.99705 11.999L2.99805 12C2.44576 12 1.99805 11.5523 1.99805 11V4C1.99805 3.44772 2.44576 3 2.99805 3H8.99805ZM19.998 4.999H16.581L16.5642 5.04018C15.8115 6.7223 14.1566 7.91251 12.2149 7.99538L11.998 8C9.96331 8 8.21245 6.7846 7.43186 5.04018L7.41405 4.999H3.99805V9.999L6.9968 9.998L6.99705 19H16.998L16.9968 10L19.998 9.999V4.999Z"></path></svg>',
|
|
63
64
|
'timer': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M17.6177 5.9681L19.0711 4.51472L20.4853 5.92893L19.0319 7.38231C20.2635 8.92199 21 10.875 21 13C21 17.9706 16.9706 22 12 22C7.02944 22 3 17.9706 3 13C3 8.02944 7.02944 4 12 4C14.125 4 16.078 4.73647 17.6177 5.9681ZM12 20C15.866 20 19 16.866 19 13C19 9.13401 15.866 6 12 6C8.13401 6 5 9.13401 5 13C5 16.866 8.13401 20 12 20ZM11 8H13V14H11V8ZM8 1H16V3H8V1Z"></path></svg>',
|
|
64
65
|
'tools': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5.32943 3.27152C6.56252 2.83314 7.9923 3.10743 8.97927 4.0944C10.1002 5.21531 10.3019 6.90735 9.5843 8.23378L20.293 18.9436L18.8788 20.3579L8.16982 9.64869C6.84325 10.3668 5.15069 10.1653 4.02952 9.04415C3.04227 8.0569 2.7681 6.62659 3.20701 5.39326L5.44373 7.62994C6.02952 8.21572 6.97927 8.21572 7.56505 7.62994C8.15084 7.04415 8.15084 6.0944 7.56505 5.50862L5.32943 3.27152ZM15.6968 5.15506L18.8788 3.38729L20.293 4.80151L18.5252 7.98349L16.7574 8.33704L14.6361 10.4584L13.2219 9.04415L15.3432 6.92283L15.6968 5.15506ZM8.97927 13.2868L10.3935 14.701L5.09018 20.0043C4.69966 20.3948 4.06649 20.3948 3.67597 20.0043C3.31334 19.6417 3.28744 19.0698 3.59826 18.6773L3.67597 18.5901L8.97927 13.2868Z"></path></svg>',
|
|
65
66
|
'user': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4 22C4 17.5817 7.58172 14 12 14C16.4183 14 20 17.5817 20 22H18C18 18.6863 15.3137 16 12 16C8.68629 16 6 18.6863 6 22H4ZM12 13C8.685 13 6 10.315 6 7C6 3.685 8.685 1 12 1C15.315 1 18 3.685 18 7C18 10.315 15.315 13 12 13ZM12 11C14.21 11 16 9.21 16 7C16 4.79 14.21 3 12 3C9.79 3 8 4.79 8 7C8 9.21 9.79 11 12 11Z"></path></svg>',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRo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BAAoyB;IAC7yB,MAAM,EAAE,8ZAA8Z;CACva,CAAC"}
|
|
@@ -57,6 +57,7 @@ export const icons: { [k: string]: string } = {
|
|
|
57
57
|
'search': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"></path></svg>',
|
|
58
58
|
'seedling-circle': '<svg version="1.1" id="Calque_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 18 18" style="enable-background:new 0 0 18 18;" xml:space="preserve"><path d="M9,18c-5,0-9-4-9-9s4-9,9-9s9,4,9,9S14,18,9,18z M9,16.2c4,0,7.2-3.2,7.2-7.2S13,1.8,9,1.8S1.8,5,1.8,9S5,16.2,9,16.2z"/><g> <g> <path d="M8.5,11.1C8,9.1,6.9,8.4,4.7,8.7c0,0,0,0-0.1,0c0,0,0,0-0.1,0c0,0,0,0,0,0.1c0,0,0,0,0,0.1C4.6,9.5,5.2,11.5,8.5,11.1z"/> <path d="M9.2,9.6c2-2.7,1.8-4.5-0.9-6.8c0,0-0.1,0-0.2,0C8,2.8,8,2.8,7.9,2.9C7.2,3.6,5.3,6.2,9.2,9.6"/> <path d="M13.3,9.5C13.3,9.5,13.4,9.5,13.3,9.5c0.1,0,0.1,0.1,0.2,0.1v0.1v0.1c-0.1,0.8-0.6,3-4.1,3.1c-0.2,0.5-0.2,1.1,0,1.6 l-0.9,0.3c-0.2-0.9-0.2-1.8,0-2.7C8.7,11.5,9,11,9.4,10.6s0.9-0.7,1.5-0.9C11.7,9.5,12.5,9.4,13.3,9.5"/> </g></g></svg>',
|
|
59
59
|
'square': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM5 5V19H19V5H5Z"></path></svg>',
|
|
60
|
+
't-shirt': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M8.99805 3C8.99805 4.65685 10.3412 6 11.998 6C13.6549 6 14.998 4.65685 14.998 3H20.998C21.5503 3 21.998 3.44772 21.998 4V11C21.998 11.5523 21.5503 12 20.998 12H18.997L18.998 20C18.998 20.5523 18.5503 21 17.998 21H5.99805C5.44576 21 4.99805 20.5523 4.99805 20L4.99705 11.999L2.99805 12C2.44576 12 1.99805 11.5523 1.99805 11V4C1.99805 3.44772 2.44576 3 2.99805 3H8.99805ZM19.998 4.999H16.581L16.5642 5.04018C15.8115 6.7223 14.1566 7.91251 12.2149 7.99538L11.998 8C9.96331 8 8.21245 6.7846 7.43186 5.04018L7.41405 4.999H3.99805V9.999L6.9968 9.998L6.99705 19H16.998L16.9968 10L19.998 9.999V4.999Z"></path></svg>',
|
|
60
61
|
'timer': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M17.6177 5.9681L19.0711 4.51472L20.4853 5.92893L19.0319 7.38231C20.2635 8.92199 21 10.875 21 13C21 17.9706 16.9706 22 12 22C7.02944 22 3 17.9706 3 13C3 8.02944 7.02944 4 12 4C14.125 4 16.078 4.73647 17.6177 5.9681ZM12 20C15.866 20 19 16.866 19 13C19 9.13401 15.866 6 12 6C8.13401 6 5 9.13401 5 13C5 16.866 8.13401 20 12 20ZM11 8H13V14H11V8ZM8 1H16V3H8V1Z"></path></svg>',
|
|
61
62
|
'tools': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5.32943 3.27152C6.56252 2.83314 7.9923 3.10743 8.97927 4.0944C10.1002 5.21531 10.3019 6.90735 9.5843 8.23378L20.293 18.9436L18.8788 20.3579L8.16982 9.64869C6.84325 10.3668 5.15069 10.1653 4.02952 9.04415C3.04227 8.0569 2.7681 6.62659 3.20701 5.39326L5.44373 7.62994C6.02952 8.21572 6.97927 8.21572 7.56505 7.62994C8.15084 7.04415 8.15084 6.0944 7.56505 5.50862L5.32943 3.27152ZM15.6968 5.15506L18.8788 3.38729L20.293 4.80151L18.5252 7.98349L16.7574 8.33704L14.6361 10.4584L13.2219 9.04415L15.3432 6.92283L15.6968 5.15506ZM8.97927 13.2868L10.3935 14.701L5.09018 20.0043C4.69966 20.3948 4.06649 20.3948 3.67597 20.0043C3.31334 19.6417 3.28744 19.0698 3.59826 18.6773L3.67597 18.5901L8.97927 13.2868Z"></path></svg>',
|
|
62
63
|
'user': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4 22C4 17.5817 7.58172 14 12 14C16.4183 14 20 17.5817 20 22H18C18 18.6863 15.3137 16 12 16C8.68629 16 6 18.6863 6 22H4ZM12 13C8.685 13 6 10.315 6 7C6 3.685 8.685 1 12 1C15.315 1 18 3.685 18 7C18 10.315 15.315 13 12 13ZM12 11C14.21 11 16 9.21 16 7C16 4.79 14.21 3 12 3C9.79 3 8 4.79 8 7C8 9.21 9.79 11 12 11Z"></path></svg>',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M8.99805 3C8.99805 4.65685 10.3412 6 11.998 6C13.6549 6 14.998 4.65685 14.998 3H20.998C21.5503 3 21.998 3.44772 21.998 4V11C21.998 11.5523 21.5503 12 20.998 12H18.997L18.998 20C18.998 20.5523 18.5503 21 17.998 21H5.99805C5.44576 21 4.99805 20.5523 4.99805 20L4.99705 11.999L2.99805 12C2.44576 12 1.99805 11.5523 1.99805 11V4C1.99805 3.44772 2.44576 3 2.99805 3H8.99805ZM19.998 4.999H16.581L16.5642 5.04018C15.8115 6.7223 14.1566 7.91251 12.2149 7.99538L11.998 8C9.96331 8 8.21245 6.7846 7.43186 5.04018L7.41405 4.999H3.99805V9.999L6.9968 9.998L6.99705 19H16.998L16.9968 10L19.998 9.999V4.999Z"></path></svg>
|
|
@@ -4,6 +4,8 @@ exports.TsLoader = void 0;
|
|
|
4
4
|
const React = require("react");
|
|
5
5
|
require("./TsLoader.css");
|
|
6
6
|
const TsLoader = ({ size = 'md' }) => {
|
|
7
|
+
// #########
|
|
8
|
+
// Rendering
|
|
7
9
|
return React.createElement("div", { className: `ts-loader ts-loader--${size}` });
|
|
8
10
|
};
|
|
9
11
|
exports.TsLoader = TsLoader;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TsLoader.js","sourceRoot":"","sources":["../../../src/components/TsLoader/TsLoader.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAE/B,0BAAwB;AAEjB,MAAM,QAAQ,GAAG,CAAC,EAAE,IAAI,GAAG,IAAI,EAAiB,EAAE,EAAE;IACzD,OAAO,6BAAK,SAAS,EAAE,wBAAwB,IAAI,EAAE,GAAI,CAAC;AAC5D,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"TsLoader.js","sourceRoot":"","sources":["../../../src/components/TsLoader/TsLoader.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAE/B,0BAAwB;AAEjB,MAAM,QAAQ,GAAG,CAAC,EAAE,IAAI,GAAG,IAAI,EAAiB,EAAE,EAAE;IACzD,YAAY;IACZ,YAAY;IACZ,OAAO,6BAAK,SAAS,EAAE,wBAAwB,IAAI,EAAE,GAAI,CAAC;AAC5D,CAAC,CAAC;AAJW,QAAA,QAAQ,YAInB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.ts-content-switcher {
|
|
2
|
+
display: flex;
|
|
3
|
+
width: 100%;
|
|
4
|
+
}
|
|
5
|
+
.ts-content-switcher > div {
|
|
6
|
+
margin-right: 8px;
|
|
7
|
+
}
|
|
8
|
+
.ts-switcher {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
height: 44px;
|
|
12
|
+
padding: 0 16px;
|
|
13
|
+
background: #ebecf7;
|
|
14
|
+
color: #3643ba;
|
|
15
|
+
font-weight: 600;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
transition: all ease 0.3s;
|
|
18
|
+
}
|
|
19
|
+
.ts-switcher--selected {
|
|
20
|
+
background: #3643ba;
|
|
21
|
+
color: #ffffff;
|
|
22
|
+
}
|
|
23
|
+
.ts-switcher-icon {
|
|
24
|
+
margin-right: 8px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* ######### */
|
|
28
|
+
/* GLOBALS */
|
|
29
|
+
* {
|
|
30
|
+
font-size: 14px;
|
|
31
|
+
outline: none;
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
|
|
34
|
+
'Helvetica Neue', sans-serif;
|
|
35
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TsSwitcher = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const TsIcon_1 = require("../TsIcon/TsIcon");
|
|
7
|
+
require("./TsSwitcher.css");
|
|
8
|
+
const TsSwitcher = ({ defaultSwitch, switchs, onChange }) => {
|
|
9
|
+
const [selectedSwitch, setSelectedSwitch] = (0, react_1.useState)(defaultSwitch ?? '');
|
|
10
|
+
// ########
|
|
11
|
+
// Handlers
|
|
12
|
+
const handleChange = (val) => {
|
|
13
|
+
setSelectedSwitch(val);
|
|
14
|
+
onChange(val);
|
|
15
|
+
};
|
|
16
|
+
// #########
|
|
17
|
+
// Rendering
|
|
18
|
+
return (React.createElement("div", { className: "ts-content-switcher" }, switchs.map(s => (React.createElement("div", { key: s.value, className: `ts-switcher ${selectedSwitch === s.value ? 'ts-switcher--selected' : ''}`, onClick: () => handleChange(s.value) },
|
|
19
|
+
s.icon && (React.createElement("div", { className: "ts-switcher-icon" },
|
|
20
|
+
React.createElement(TsIcon_1.TsIcon, { name: s.icon }))),
|
|
21
|
+
React.createElement("div", { className: "ts-switcher-label" }, s.label))))));
|
|
22
|
+
};
|
|
23
|
+
exports.TsSwitcher = TsSwitcher;
|
|
24
|
+
//# sourceMappingURL=TsSwitcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TsSwitcher.js","sourceRoot":"","sources":["../../../src/components/TsSwitcher/TsSwitcher.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,iCAAiC;AACjC,6CAA0C;AAE1C,4BAA0B;AAEnB,MAAM,UAAU,GAAG,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAmB,EAAE,EAAE;IAClF,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,IAAA,gBAAQ,EAAS,aAAa,IAAI,EAAE,CAAC,CAAC;IAElF,WAAW;IACX,WAAW;IACX,MAAM,YAAY,GAAG,CAAC,GAAW,EAAE,EAAE;QACnC,iBAAiB,CAAC,GAAG,CAAC,CAAC;QACvB,QAAQ,CAAC,GAAG,CAAC,CAAC;IAChB,CAAC,CAAC;IAEF,YAAY;IACZ,YAAY;IACZ,OAAO,CACL,6BAAK,SAAS,EAAC,qBAAqB,IACjC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAChB,6BACE,GAAG,EAAE,CAAC,CAAC,KAAK,EACZ,SAAS,EAAE,eAAe,cAAc,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,EAAE,EACrF,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC;QAEnC,CAAC,CAAC,IAAI,IAAI,CACT,6BAAK,SAAS,EAAC,kBAAkB;YAC/B,oBAAC,eAAM,IAAC,IAAI,EAAE,CAAC,CAAC,IAAI,GAAI,CACpB,CACP;QACD,6BAAK,SAAS,EAAC,mBAAmB,IAAE,CAAC,CAAC,KAAK,CAAO,CAC9C,CACP,CAAC,CACE,CACP,CAAC;AACJ,CAAC,CAAC;AA9BW,QAAA,UAAU,cA8BrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TsSwitcher.types.js","sourceRoot":"","sources":["../../../src/components/TsSwitcher/TsSwitcher.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ArgsTable, Canvas, Meta, Story } from '@storybook/blocks';
|
|
3
|
+
import { icons } from '../../TsIcon/icons';
|
|
4
|
+
import { TsSwitcher } from '../TsSwitcher';
|
|
5
|
+
|
|
6
|
+
<Meta title="Components/Switcher" />
|
|
7
|
+
|
|
8
|
+
export const switcherArgTypes = {};
|
|
9
|
+
|
|
10
|
+
# Switcher
|
|
11
|
+
|
|
12
|
+
Content switchers allow users to toggle between two or more content sections within the same space on the screen.
|
|
13
|
+
|
|
14
|
+
## Overview
|
|
15
|
+
|
|
16
|
+
<Canvas>
|
|
17
|
+
<Story
|
|
18
|
+
name="Overview"
|
|
19
|
+
args={{
|
|
20
|
+
switchs: [
|
|
21
|
+
{ icon: 'check', label: 'Section 1', value: 'section-1' },
|
|
22
|
+
{ icon: 'delete-bin', label: 'Section 2', value: 'section-2' },
|
|
23
|
+
],
|
|
24
|
+
onChange: () => {},
|
|
25
|
+
}}
|
|
26
|
+
argTypes={switcherArgTypes}
|
|
27
|
+
>
|
|
28
|
+
{args => <TsSwitcher {...args} />}
|
|
29
|
+
</Story>
|
|
30
|
+
</Canvas>
|
|
31
|
+
|
|
32
|
+
## Props
|
|
33
|
+
|
|
34
|
+
<ArgsTable story="Overview" of={TsSwitcher} />
|
package/lib/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from './components/TsIcon/TsIcon';
|
|
|
6
6
|
export * from './components/TsInput/TsBooleanInput/TsBooleanInput';
|
|
7
7
|
export * from './components/TsInput/TsInput/TsInput';
|
|
8
8
|
export * from './components/TsLoader/TsLoader';
|
|
9
|
+
export * from './components/TsSwitcher/TsSwitcher';
|
|
9
10
|
export * from './components/TsTabs/TsTabs';
|
|
10
11
|
export * from './layouts/TsHeader/TsHeader';
|
|
11
12
|
export * from './layouts/TsHeader/TsHeaderProfile';
|
package/lib/index.js
CHANGED
|
@@ -22,6 +22,7 @@ __exportStar(require("./components/TsIcon/TsIcon"), exports);
|
|
|
22
22
|
__exportStar(require("./components/TsInput/TsBooleanInput/TsBooleanInput"), exports);
|
|
23
23
|
__exportStar(require("./components/TsInput/TsInput/TsInput"), exports);
|
|
24
24
|
__exportStar(require("./components/TsLoader/TsLoader"), exports);
|
|
25
|
+
__exportStar(require("./components/TsSwitcher/TsSwitcher"), exports);
|
|
25
26
|
__exportStar(require("./components/TsTabs/TsTabs"), exports);
|
|
26
27
|
__exportStar(require("./layouts/TsHeader/TsHeader"), exports);
|
|
27
28
|
__exportStar(require("./layouts/TsHeader/TsHeaderProfile"), exports);
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iEAA+C;AAC/C,qEAAmD;AACnD,iFAA+D;AAC/D,6FAA2E;AAC3E,6DAA2C;AAC3C,qFAAmE;AACnE,uEAAqD;AACrD,iEAA+C;AAC/C,6DAA2C;AAC3C,8DAA4C;AAC5C,qEAAmD;AACnD,sEAAoD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iEAA+C;AAC/C,qEAAmD;AACnD,iFAA+D;AAC/D,6FAA2E;AAC3E,6DAA2C;AAC3C,qFAAmE;AACnE,uEAAqD;AACrD,iEAA+C;AAC/C,qEAAmD;AACnD,6DAA2C;AAC3C,8DAA4C;AAC5C,qEAAmD;AACnD,sEAAoD"}
|
package/package.json
CHANGED
|
@@ -57,6 +57,7 @@ export const icons: { [k: string]: string } = {
|
|
|
57
57
|
'search': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"></path></svg>',
|
|
58
58
|
'seedling-circle': '<svg version="1.1" id="Calque_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 18 18" style="enable-background:new 0 0 18 18;" xml:space="preserve"><path d="M9,18c-5,0-9-4-9-9s4-9,9-9s9,4,9,9S14,18,9,18z M9,16.2c4,0,7.2-3.2,7.2-7.2S13,1.8,9,1.8S1.8,5,1.8,9S5,16.2,9,16.2z"/><g> <g> <path d="M8.5,11.1C8,9.1,6.9,8.4,4.7,8.7c0,0,0,0-0.1,0c0,0,0,0-0.1,0c0,0,0,0,0,0.1c0,0,0,0,0,0.1C4.6,9.5,5.2,11.5,8.5,11.1z"/> <path d="M9.2,9.6c2-2.7,1.8-4.5-0.9-6.8c0,0-0.1,0-0.2,0C8,2.8,8,2.8,7.9,2.9C7.2,3.6,5.3,6.2,9.2,9.6"/> <path d="M13.3,9.5C13.3,9.5,13.4,9.5,13.3,9.5c0.1,0,0.1,0.1,0.2,0.1v0.1v0.1c-0.1,0.8-0.6,3-4.1,3.1c-0.2,0.5-0.2,1.1,0,1.6 l-0.9,0.3c-0.2-0.9-0.2-1.8,0-2.7C8.7,11.5,9,11,9.4,10.6s0.9-0.7,1.5-0.9C11.7,9.5,12.5,9.4,13.3,9.5"/> </g></g></svg>',
|
|
59
59
|
'square': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM5 5V19H19V5H5Z"></path></svg>',
|
|
60
|
+
't-shirt': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M8.99805 3C8.99805 4.65685 10.3412 6 11.998 6C13.6549 6 14.998 4.65685 14.998 3H20.998C21.5503 3 21.998 3.44772 21.998 4V11C21.998 11.5523 21.5503 12 20.998 12H18.997L18.998 20C18.998 20.5523 18.5503 21 17.998 21H5.99805C5.44576 21 4.99805 20.5523 4.99805 20L4.99705 11.999L2.99805 12C2.44576 12 1.99805 11.5523 1.99805 11V4C1.99805 3.44772 2.44576 3 2.99805 3H8.99805ZM19.998 4.999H16.581L16.5642 5.04018C15.8115 6.7223 14.1566 7.91251 12.2149 7.99538L11.998 8C9.96331 8 8.21245 6.7846 7.43186 5.04018L7.41405 4.999H3.99805V9.999L6.9968 9.998L6.99705 19H16.998L16.9968 10L19.998 9.999V4.999Z"></path></svg>',
|
|
60
61
|
'timer': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M17.6177 5.9681L19.0711 4.51472L20.4853 5.92893L19.0319 7.38231C20.2635 8.92199 21 10.875 21 13C21 17.9706 16.9706 22 12 22C7.02944 22 3 17.9706 3 13C3 8.02944 7.02944 4 12 4C14.125 4 16.078 4.73647 17.6177 5.9681ZM12 20C15.866 20 19 16.866 19 13C19 9.13401 15.866 6 12 6C8.13401 6 5 9.13401 5 13C5 16.866 8.13401 20 12 20ZM11 8H13V14H11V8ZM8 1H16V3H8V1Z"></path></svg>',
|
|
61
62
|
'tools': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5.32943 3.27152C6.56252 2.83314 7.9923 3.10743 8.97927 4.0944C10.1002 5.21531 10.3019 6.90735 9.5843 8.23378L20.293 18.9436L18.8788 20.3579L8.16982 9.64869C6.84325 10.3668 5.15069 10.1653 4.02952 9.04415C3.04227 8.0569 2.7681 6.62659 3.20701 5.39326L5.44373 7.62994C6.02952 8.21572 6.97927 8.21572 7.56505 7.62994C8.15084 7.04415 8.15084 6.0944 7.56505 5.50862L5.32943 3.27152ZM15.6968 5.15506L18.8788 3.38729L20.293 4.80151L18.5252 7.98349L16.7574 8.33704L14.6361 10.4584L13.2219 9.04415L15.3432 6.92283L15.6968 5.15506ZM8.97927 13.2868L10.3935 14.701L5.09018 20.0043C4.69966 20.3948 4.06649 20.3948 3.67597 20.0043C3.31334 19.6417 3.28744 19.0698 3.59826 18.6773L3.67597 18.5901L8.97927 13.2868Z"></path></svg>',
|
|
62
63
|
'user': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4 22C4 17.5817 7.58172 14 12 14C16.4183 14 20 17.5817 20 22H18C18 18.6863 15.3137 16 12 16C8.68629 16 6 18.6863 6 22H4ZM12 13C8.685 13 6 10.315 6 7C6 3.685 8.685 1 12 1C15.315 1 18 3.685 18 7C18 10.315 15.315 13 12 13ZM12 11C14.21 11 16 9.21 16 7C16 4.79 14.21 3 12 3C9.79 3 8 4.79 8 7C8 9.21 9.79 11 12 11Z"></path></svg>',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M8.99805 3C8.99805 4.65685 10.3412 6 11.998 6C13.6549 6 14.998 4.65685 14.998 3H20.998C21.5503 3 21.998 3.44772 21.998 4V11C21.998 11.5523 21.5503 12 20.998 12H18.997L18.998 20C18.998 20.5523 18.5503 21 17.998 21H5.99805C5.44576 21 4.99805 20.5523 4.99805 20L4.99705 11.999L2.99805 12C2.44576 12 1.99805 11.5523 1.99805 11V4C1.99805 3.44772 2.44576 3 2.99805 3H8.99805ZM19.998 4.999H16.581L16.5642 5.04018C15.8115 6.7223 14.1566 7.91251 12.2149 7.99538L11.998 8C9.96331 8 8.21245 6.7846 7.43186 5.04018L7.41405 4.999H3.99805V9.999L6.9968 9.998L6.99705 19H16.998L16.9968 10L19.998 9.999V4.999Z"></path></svg>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.ts-content-switcher {
|
|
2
|
+
display: flex;
|
|
3
|
+
width: 100%;
|
|
4
|
+
}
|
|
5
|
+
.ts-content-switcher > div {
|
|
6
|
+
margin-right: 8px;
|
|
7
|
+
}
|
|
8
|
+
.ts-switcher {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
height: 44px;
|
|
12
|
+
padding: 0 16px;
|
|
13
|
+
background: #ebecf7;
|
|
14
|
+
color: #3643ba;
|
|
15
|
+
font-weight: 600;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
transition: all ease 0.3s;
|
|
18
|
+
}
|
|
19
|
+
.ts-switcher--selected {
|
|
20
|
+
background: #3643ba;
|
|
21
|
+
color: #ffffff;
|
|
22
|
+
}
|
|
23
|
+
.ts-switcher-icon {
|
|
24
|
+
margin-right: 8px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* ######### */
|
|
28
|
+
/* GLOBALS */
|
|
29
|
+
* {
|
|
30
|
+
font-size: 14px;
|
|
31
|
+
outline: none;
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
|
|
34
|
+
'Helvetica Neue', sans-serif;
|
|
35
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { TsIcon } from '../TsIcon/TsIcon';
|
|
4
|
+
import { TsSwitcherProps } from './TsSwitcher.types';
|
|
5
|
+
import './TsSwitcher.css';
|
|
6
|
+
|
|
7
|
+
export const TsSwitcher = ({ defaultSwitch, switchs, onChange }: TsSwitcherProps) => {
|
|
8
|
+
const [selectedSwitch, setSelectedSwitch] = useState<string>(defaultSwitch ?? '');
|
|
9
|
+
|
|
10
|
+
// ########
|
|
11
|
+
// Handlers
|
|
12
|
+
const handleChange = (val: string) => {
|
|
13
|
+
setSelectedSwitch(val);
|
|
14
|
+
onChange(val);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// #########
|
|
18
|
+
// Rendering
|
|
19
|
+
return (
|
|
20
|
+
<div className="ts-content-switcher">
|
|
21
|
+
{switchs.map(s => (
|
|
22
|
+
<div
|
|
23
|
+
key={s.value}
|
|
24
|
+
className={`ts-switcher ${selectedSwitch === s.value ? 'ts-switcher--selected' : ''}`}
|
|
25
|
+
onClick={() => handleChange(s.value)}
|
|
26
|
+
>
|
|
27
|
+
{s.icon && (
|
|
28
|
+
<div className="ts-switcher-icon">
|
|
29
|
+
<TsIcon name={s.icon} />
|
|
30
|
+
</div>
|
|
31
|
+
)}
|
|
32
|
+
<div className="ts-switcher-label">{s.label}</div>
|
|
33
|
+
</div>
|
|
34
|
+
))}
|
|
35
|
+
</div>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ArgsTable, Canvas, Meta, Story } from '@storybook/blocks';
|
|
3
|
+
import { icons } from '../../TsIcon/icons';
|
|
4
|
+
import { TsSwitcher } from '../TsSwitcher';
|
|
5
|
+
|
|
6
|
+
<Meta title="Components/Switcher" />
|
|
7
|
+
|
|
8
|
+
export const switcherArgTypes = {};
|
|
9
|
+
|
|
10
|
+
# Switcher
|
|
11
|
+
|
|
12
|
+
Content switchers allow users to toggle between two or more content sections within the same space on the screen.
|
|
13
|
+
|
|
14
|
+
## Overview
|
|
15
|
+
|
|
16
|
+
<Canvas>
|
|
17
|
+
<Story
|
|
18
|
+
name="Overview"
|
|
19
|
+
args={{
|
|
20
|
+
switchs: [
|
|
21
|
+
{ icon: 'check', label: 'Section 1', value: 'section-1' },
|
|
22
|
+
{ icon: 'delete-bin', label: 'Section 2', value: 'section-2' },
|
|
23
|
+
],
|
|
24
|
+
onChange: () => {},
|
|
25
|
+
}}
|
|
26
|
+
argTypes={switcherArgTypes}
|
|
27
|
+
>
|
|
28
|
+
{args => <TsSwitcher {...args} />}
|
|
29
|
+
</Story>
|
|
30
|
+
</Canvas>
|
|
31
|
+
|
|
32
|
+
## Props
|
|
33
|
+
|
|
34
|
+
<ArgsTable story="Overview" of={TsSwitcher} />
|
package/src/index.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from './components/TsIcon/TsIcon';
|
|
|
6
6
|
export * from './components/TsInput/TsBooleanInput/TsBooleanInput';
|
|
7
7
|
export * from './components/TsInput/TsInput/TsInput';
|
|
8
8
|
export * from './components/TsLoader/TsLoader';
|
|
9
|
+
export * from './components/TsSwitcher/TsSwitcher';
|
|
9
10
|
export * from './components/TsTabs/TsTabs';
|
|
10
11
|
export * from './layouts/TsHeader/TsHeader';
|
|
11
12
|
export * from './layouts/TsHeader/TsHeaderProfile';
|