@purpurds/illustrative-icon 0.0.1
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/dist/404-error-duocolor-BqBZuhak.mjs +65617 -0
- package/dist/404-error-duocolor-BqBZuhak.mjs.map +1 -0
- package/dist/404-error-duocolor-Co5mBm6H.js +674 -0
- package/dist/404-error-duocolor-Co5mBm6H.js.map +1 -0
- package/dist/LICENSE.txt +30 -0
- package/dist/all-illustrative-icon-components.d.ts +41 -0
- package/dist/all-illustrative-icon-components.d.ts.map +1 -0
- package/dist/assets/404-error-duocolor.json.d.ts +3 -0
- package/dist/assets/404-error-offblack.json.d.ts +3 -0
- package/dist/assets/cart-checkmark-duocolor.json.d.ts +3 -0
- package/dist/assets/cart-checkmark-offblack.json.d.ts +3 -0
- package/dist/assets/checkmark-duocolor.json.d.ts +3 -0
- package/dist/assets/checkmark-offblack.json.d.ts +3 -0
- package/dist/assets/document-checkmark-duocolor.json.d.ts +3 -0
- package/dist/assets/document-checkmark-offblack.json.d.ts +3 -0
- package/dist/assets/getting-started-duocolor.json.d.ts +3 -0
- package/dist/assets/getting-started-offblack.json.d.ts +3 -0
- package/dist/assets/hand-heart-duocolor.json.d.ts +3 -0
- package/dist/assets/hand-heart-offblack.json.d.ts +3 -0
- package/dist/assets/id-error-duocolor.json.d.ts +3 -0
- package/dist/assets/id-error-offblack.json.d.ts +3 -0
- package/dist/assets/search-duocolor.json.d.ts +3 -0
- package/dist/assets/search-field-duocolor.json.d.ts +3 -0
- package/dist/assets/search-field-offblack.json.d.ts +3 -0
- package/dist/assets/search-offblack.json.d.ts +3 -0
- package/dist/assets/search-question-duocolor.json.d.ts +3 -0
- package/dist/assets/search-question-offblack.json.d.ts +3 -0
- package/dist/assets/settings-time-duocolor.json.d.ts +3 -0
- package/dist/assets/settings-time-offblack.json.d.ts +3 -0
- package/dist/assets/support-checkmark-duocolor.json.d.ts +3 -0
- package/dist/assets/support-checkmark-offblack.json.d.ts +3 -0
- package/dist/assets/technical-error-duocolor.json.d.ts +3 -0
- package/dist/assets/technical-error-offblack.json.d.ts +3 -0
- package/dist/assets/user-checkmark-duocolor.json.d.ts +3 -0
- package/dist/assets/user-checkmark-offblack.json.d.ts +3 -0
- package/dist/assets/user-error-duocolor.json.d.ts +3 -0
- package/dist/assets/user-error-offblack.json.d.ts +3 -0
- package/dist/assets/user-lock-duocolor.json.d.ts +3 -0
- package/dist/assets/user-lock-offblack.json.d.ts +3 -0
- package/dist/assets/user-plus-duocolor.json.d.ts +3 -0
- package/dist/assets/user-plus-offblack.json.d.ts +3 -0
- package/dist/assets/user-settings-duocolor.json.d.ts +3 -0
- package/dist/assets/user-settings-offblack.json.d.ts +3 -0
- package/dist/components/404-error-duocolor.cjs.js +2 -0
- package/dist/components/404-error-duocolor.cjs.js.map +1 -0
- package/dist/components/404-error-duocolor.d.ts +8 -0
- package/dist/components/404-error-duocolor.d.ts.map +1 -0
- package/dist/components/404-error-duocolor.es.js +6 -0
- package/dist/components/404-error-duocolor.es.js.map +1 -0
- package/dist/components/404-error-offblack.cjs.js +2 -0
- package/dist/components/404-error-offblack.cjs.js.map +1 -0
- package/dist/components/404-error-offblack.d.ts +8 -0
- package/dist/components/404-error-offblack.d.ts.map +1 -0
- package/dist/components/404-error-offblack.es.js +6 -0
- package/dist/components/404-error-offblack.es.js.map +1 -0
- package/dist/components/cart-checkmark-duocolor.cjs.js +2 -0
- package/dist/components/cart-checkmark-duocolor.cjs.js.map +1 -0
- package/dist/components/cart-checkmark-duocolor.d.ts +8 -0
- package/dist/components/cart-checkmark-duocolor.d.ts.map +1 -0
- package/dist/components/cart-checkmark-duocolor.es.js +6 -0
- package/dist/components/cart-checkmark-duocolor.es.js.map +1 -0
- package/dist/components/cart-checkmark-offblack.cjs.js +2 -0
- package/dist/components/cart-checkmark-offblack.cjs.js.map +1 -0
- package/dist/components/cart-checkmark-offblack.d.ts +8 -0
- package/dist/components/cart-checkmark-offblack.d.ts.map +1 -0
- package/dist/components/cart-checkmark-offblack.es.js +6 -0
- package/dist/components/cart-checkmark-offblack.es.js.map +1 -0
- package/dist/components/checkmark-duocolor.cjs.js +2 -0
- package/dist/components/checkmark-duocolor.cjs.js.map +1 -0
- package/dist/components/checkmark-duocolor.d.ts +8 -0
- package/dist/components/checkmark-duocolor.d.ts.map +1 -0
- package/dist/components/checkmark-duocolor.es.js +6 -0
- package/dist/components/checkmark-duocolor.es.js.map +1 -0
- package/dist/components/checkmark-offblack.cjs.js +2 -0
- package/dist/components/checkmark-offblack.cjs.js.map +1 -0
- package/dist/components/checkmark-offblack.d.ts +8 -0
- package/dist/components/checkmark-offblack.d.ts.map +1 -0
- package/dist/components/checkmark-offblack.es.js +6 -0
- package/dist/components/checkmark-offblack.es.js.map +1 -0
- package/dist/components/document-checkmark-duocolor.cjs.js +2 -0
- package/dist/components/document-checkmark-duocolor.cjs.js.map +1 -0
- package/dist/components/document-checkmark-duocolor.d.ts +8 -0
- package/dist/components/document-checkmark-duocolor.d.ts.map +1 -0
- package/dist/components/document-checkmark-duocolor.es.js +6 -0
- package/dist/components/document-checkmark-duocolor.es.js.map +1 -0
- package/dist/components/document-checkmark-offblack.cjs.js +2 -0
- package/dist/components/document-checkmark-offblack.cjs.js.map +1 -0
- package/dist/components/document-checkmark-offblack.d.ts +8 -0
- package/dist/components/document-checkmark-offblack.d.ts.map +1 -0
- package/dist/components/document-checkmark-offblack.es.js +6 -0
- package/dist/components/document-checkmark-offblack.es.js.map +1 -0
- package/dist/components/getting-started-duocolor.cjs.js +2 -0
- package/dist/components/getting-started-duocolor.cjs.js.map +1 -0
- package/dist/components/getting-started-duocolor.d.ts +8 -0
- package/dist/components/getting-started-duocolor.d.ts.map +1 -0
- package/dist/components/getting-started-duocolor.es.js +6 -0
- package/dist/components/getting-started-duocolor.es.js.map +1 -0
- package/dist/components/getting-started-offblack.cjs.js +2 -0
- package/dist/components/getting-started-offblack.cjs.js.map +1 -0
- package/dist/components/getting-started-offblack.d.ts +8 -0
- package/dist/components/getting-started-offblack.d.ts.map +1 -0
- package/dist/components/getting-started-offblack.es.js +6 -0
- package/dist/components/getting-started-offblack.es.js.map +1 -0
- package/dist/components/hand-heart-duocolor.cjs.js +2 -0
- package/dist/components/hand-heart-duocolor.cjs.js.map +1 -0
- package/dist/components/hand-heart-duocolor.d.ts +8 -0
- package/dist/components/hand-heart-duocolor.d.ts.map +1 -0
- package/dist/components/hand-heart-duocolor.es.js +6 -0
- package/dist/components/hand-heart-duocolor.es.js.map +1 -0
- package/dist/components/hand-heart-offblack.cjs.js +2 -0
- package/dist/components/hand-heart-offblack.cjs.js.map +1 -0
- package/dist/components/hand-heart-offblack.d.ts +8 -0
- package/dist/components/hand-heart-offblack.d.ts.map +1 -0
- package/dist/components/hand-heart-offblack.es.js +6 -0
- package/dist/components/hand-heart-offblack.es.js.map +1 -0
- package/dist/components/id-error-duocolor.cjs.js +2 -0
- package/dist/components/id-error-duocolor.cjs.js.map +1 -0
- package/dist/components/id-error-duocolor.d.ts +8 -0
- package/dist/components/id-error-duocolor.d.ts.map +1 -0
- package/dist/components/id-error-duocolor.es.js +6 -0
- package/dist/components/id-error-duocolor.es.js.map +1 -0
- package/dist/components/id-error-offblack.cjs.js +2 -0
- package/dist/components/id-error-offblack.cjs.js.map +1 -0
- package/dist/components/id-error-offblack.d.ts +8 -0
- package/dist/components/id-error-offblack.d.ts.map +1 -0
- package/dist/components/id-error-offblack.es.js +6 -0
- package/dist/components/id-error-offblack.es.js.map +1 -0
- package/dist/components/search-duocolor.cjs.js +2 -0
- package/dist/components/search-duocolor.cjs.js.map +1 -0
- package/dist/components/search-duocolor.d.ts +8 -0
- package/dist/components/search-duocolor.d.ts.map +1 -0
- package/dist/components/search-duocolor.es.js +6 -0
- package/dist/components/search-duocolor.es.js.map +1 -0
- package/dist/components/search-field-duocolor.cjs.js +2 -0
- package/dist/components/search-field-duocolor.cjs.js.map +1 -0
- package/dist/components/search-field-duocolor.d.ts +8 -0
- package/dist/components/search-field-duocolor.d.ts.map +1 -0
- package/dist/components/search-field-duocolor.es.js +6 -0
- package/dist/components/search-field-duocolor.es.js.map +1 -0
- package/dist/components/search-field-offblack.cjs.js +2 -0
- package/dist/components/search-field-offblack.cjs.js.map +1 -0
- package/dist/components/search-field-offblack.d.ts +8 -0
- package/dist/components/search-field-offblack.d.ts.map +1 -0
- package/dist/components/search-field-offblack.es.js +6 -0
- package/dist/components/search-field-offblack.es.js.map +1 -0
- package/dist/components/search-offblack.cjs.js +2 -0
- package/dist/components/search-offblack.cjs.js.map +1 -0
- package/dist/components/search-offblack.d.ts +8 -0
- package/dist/components/search-offblack.d.ts.map +1 -0
- package/dist/components/search-offblack.es.js +6 -0
- package/dist/components/search-offblack.es.js.map +1 -0
- package/dist/components/search-question-duocolor.cjs.js +2 -0
- package/dist/components/search-question-duocolor.cjs.js.map +1 -0
- package/dist/components/search-question-duocolor.d.ts +8 -0
- package/dist/components/search-question-duocolor.d.ts.map +1 -0
- package/dist/components/search-question-duocolor.es.js +6 -0
- package/dist/components/search-question-duocolor.es.js.map +1 -0
- package/dist/components/search-question-offblack.cjs.js +2 -0
- package/dist/components/search-question-offblack.cjs.js.map +1 -0
- package/dist/components/search-question-offblack.d.ts +8 -0
- package/dist/components/search-question-offblack.d.ts.map +1 -0
- package/dist/components/search-question-offblack.es.js +6 -0
- package/dist/components/search-question-offblack.es.js.map +1 -0
- package/dist/components/settings-time-duocolor.cjs.js +2 -0
- package/dist/components/settings-time-duocolor.cjs.js.map +1 -0
- package/dist/components/settings-time-duocolor.d.ts +8 -0
- package/dist/components/settings-time-duocolor.d.ts.map +1 -0
- package/dist/components/settings-time-duocolor.es.js +6 -0
- package/dist/components/settings-time-duocolor.es.js.map +1 -0
- package/dist/components/settings-time-offblack.cjs.js +2 -0
- package/dist/components/settings-time-offblack.cjs.js.map +1 -0
- package/dist/components/settings-time-offblack.d.ts +8 -0
- package/dist/components/settings-time-offblack.d.ts.map +1 -0
- package/dist/components/settings-time-offblack.es.js +6 -0
- package/dist/components/settings-time-offblack.es.js.map +1 -0
- package/dist/components/support-checkmark-duocolor.cjs.js +2 -0
- package/dist/components/support-checkmark-duocolor.cjs.js.map +1 -0
- package/dist/components/support-checkmark-duocolor.d.ts +8 -0
- package/dist/components/support-checkmark-duocolor.d.ts.map +1 -0
- package/dist/components/support-checkmark-duocolor.es.js +6 -0
- package/dist/components/support-checkmark-duocolor.es.js.map +1 -0
- package/dist/components/support-checkmark-offblack.cjs.js +2 -0
- package/dist/components/support-checkmark-offblack.cjs.js.map +1 -0
- package/dist/components/support-checkmark-offblack.d.ts +8 -0
- package/dist/components/support-checkmark-offblack.d.ts.map +1 -0
- package/dist/components/support-checkmark-offblack.es.js +6 -0
- package/dist/components/support-checkmark-offblack.es.js.map +1 -0
- package/dist/components/technical-error-duocolor.cjs.js +2 -0
- package/dist/components/technical-error-duocolor.cjs.js.map +1 -0
- package/dist/components/technical-error-duocolor.d.ts +8 -0
- package/dist/components/technical-error-duocolor.d.ts.map +1 -0
- package/dist/components/technical-error-duocolor.es.js +6 -0
- package/dist/components/technical-error-duocolor.es.js.map +1 -0
- package/dist/components/technical-error-offblack.cjs.js +2 -0
- package/dist/components/technical-error-offblack.cjs.js.map +1 -0
- package/dist/components/technical-error-offblack.d.ts +8 -0
- package/dist/components/technical-error-offblack.d.ts.map +1 -0
- package/dist/components/technical-error-offblack.es.js +6 -0
- package/dist/components/technical-error-offblack.es.js.map +1 -0
- package/dist/components/user-checkmark-duocolor.cjs.js +2 -0
- package/dist/components/user-checkmark-duocolor.cjs.js.map +1 -0
- package/dist/components/user-checkmark-duocolor.d.ts +8 -0
- package/dist/components/user-checkmark-duocolor.d.ts.map +1 -0
- package/dist/components/user-checkmark-duocolor.es.js +6 -0
- package/dist/components/user-checkmark-duocolor.es.js.map +1 -0
- package/dist/components/user-checkmark-offblack.cjs.js +2 -0
- package/dist/components/user-checkmark-offblack.cjs.js.map +1 -0
- package/dist/components/user-checkmark-offblack.d.ts +8 -0
- package/dist/components/user-checkmark-offblack.d.ts.map +1 -0
- package/dist/components/user-checkmark-offblack.es.js +6 -0
- package/dist/components/user-checkmark-offblack.es.js.map +1 -0
- package/dist/components/user-error-duocolor.cjs.js +2 -0
- package/dist/components/user-error-duocolor.cjs.js.map +1 -0
- package/dist/components/user-error-duocolor.d.ts +8 -0
- package/dist/components/user-error-duocolor.d.ts.map +1 -0
- package/dist/components/user-error-duocolor.es.js +6 -0
- package/dist/components/user-error-duocolor.es.js.map +1 -0
- package/dist/components/user-error-offblack.cjs.js +2 -0
- package/dist/components/user-error-offblack.cjs.js.map +1 -0
- package/dist/components/user-error-offblack.d.ts +8 -0
- package/dist/components/user-error-offblack.d.ts.map +1 -0
- package/dist/components/user-error-offblack.es.js +6 -0
- package/dist/components/user-error-offblack.es.js.map +1 -0
- package/dist/components/user-lock-duocolor.cjs.js +2 -0
- package/dist/components/user-lock-duocolor.cjs.js.map +1 -0
- package/dist/components/user-lock-duocolor.d.ts +8 -0
- package/dist/components/user-lock-duocolor.d.ts.map +1 -0
- package/dist/components/user-lock-duocolor.es.js +6 -0
- package/dist/components/user-lock-duocolor.es.js.map +1 -0
- package/dist/components/user-lock-offblack.cjs.js +2 -0
- package/dist/components/user-lock-offblack.cjs.js.map +1 -0
- package/dist/components/user-lock-offblack.d.ts +8 -0
- package/dist/components/user-lock-offblack.d.ts.map +1 -0
- package/dist/components/user-lock-offblack.es.js +6 -0
- package/dist/components/user-lock-offblack.es.js.map +1 -0
- package/dist/components/user-plus-duocolor.cjs.js +2 -0
- package/dist/components/user-plus-duocolor.cjs.js.map +1 -0
- package/dist/components/user-plus-duocolor.d.ts +8 -0
- package/dist/components/user-plus-duocolor.d.ts.map +1 -0
- package/dist/components/user-plus-duocolor.es.js +6 -0
- package/dist/components/user-plus-duocolor.es.js.map +1 -0
- package/dist/components/user-plus-offblack.cjs.js +2 -0
- package/dist/components/user-plus-offblack.cjs.js.map +1 -0
- package/dist/components/user-plus-offblack.d.ts +8 -0
- package/dist/components/user-plus-offblack.d.ts.map +1 -0
- package/dist/components/user-plus-offblack.es.js +6 -0
- package/dist/components/user-plus-offblack.es.js.map +1 -0
- package/dist/components/user-settings-duocolor.cjs.js +2 -0
- package/dist/components/user-settings-duocolor.cjs.js.map +1 -0
- package/dist/components/user-settings-duocolor.d.ts +8 -0
- package/dist/components/user-settings-duocolor.d.ts.map +1 -0
- package/dist/components/user-settings-duocolor.es.js +6 -0
- package/dist/components/user-settings-duocolor.es.js.map +1 -0
- package/dist/components/user-settings-offblack.cjs.js +2 -0
- package/dist/components/user-settings-offblack.cjs.js.map +1 -0
- package/dist/components/user-settings-offblack.d.ts +8 -0
- package/dist/components/user-settings-offblack.d.ts.map +1 -0
- package/dist/components/user-settings-offblack.es.js +6 -0
- package/dist/components/user-settings-offblack.es.js.map +1 -0
- package/dist/illustrative-icon.cjs.js +674 -0
- package/dist/illustrative-icon.cjs.js.map +1 -0
- package/dist/illustrative-icon.d.ts +17 -0
- package/dist/illustrative-icon.d.ts.map +1 -0
- package/dist/illustrative-icon.es.js +65617 -0
- package/dist/illustrative-icon.es.js.map +1 -0
- package/package.json +67 -0
- package/scripts/build.mts +47 -0
- package/scripts/generate-components.mts +35 -0
- package/scripts/generate-icon-imports.mts +37 -0
- package/src/all-illustrative-icon-components.tsx +41 -0
- package/src/assets/404-error-duocolor.json +1 -0
- package/src/assets/404-error-offblack.json +1 -0
- package/src/assets/cart-checkmark-duocolor.json +1 -0
- package/src/assets/cart-checkmark-offblack.json +1 -0
- package/src/assets/checkmark-duocolor.json +1 -0
- package/src/assets/checkmark-offblack.json +1 -0
- package/src/assets/document-checkmark-duocolor.json +1 -0
- package/src/assets/document-checkmark-offblack.json +1 -0
- package/src/assets/getting-started-duocolor.json +1 -0
- package/src/assets/getting-started-offblack.json +1 -0
- package/src/assets/hand-heart-duocolor.json +1 -0
- package/src/assets/hand-heart-offblack.json +1 -0
- package/src/assets/id-error-duocolor.json +1 -0
- package/src/assets/id-error-offblack.json +1 -0
- package/src/assets/search-duocolor.json +1 -0
- package/src/assets/search-field-duocolor.json +1 -0
- package/src/assets/search-field-offblack.json +1 -0
- package/src/assets/search-offblack.json +1 -0
- package/src/assets/search-question-duocolor.json +1 -0
- package/src/assets/search-question-offblack.json +1 -0
- package/src/assets/settings-time-duocolor.json +1 -0
- package/src/assets/settings-time-offblack.json +1 -0
- package/src/assets/support-checkmark-duocolor.json +1 -0
- package/src/assets/support-checkmark-offblack.json +1 -0
- package/src/assets/technical-error-duocolor.json +1 -0
- package/src/assets/technical-error-offblack.json +1 -0
- package/src/assets/user-checkmark-duocolor.json +1 -0
- package/src/assets/user-checkmark-offblack.json +1 -0
- package/src/assets/user-error-duocolor.json +1 -0
- package/src/assets/user-error-offblack.json +1 -0
- package/src/assets/user-lock-duocolor.json +1 -0
- package/src/assets/user-lock-offblack.json +1 -0
- package/src/assets/user-plus-duocolor.json +1 -0
- package/src/assets/user-plus-offblack.json +1 -0
- package/src/assets/user-settings-duocolor.json +1 -0
- package/src/assets/user-settings-offblack.json +1 -0
- package/src/components/404-error-duocolor.tsx +15 -0
- package/src/components/404-error-offblack.tsx +15 -0
- package/src/components/cart-checkmark-duocolor.tsx +15 -0
- package/src/components/cart-checkmark-offblack.tsx +15 -0
- package/src/components/checkmark-duocolor.tsx +15 -0
- package/src/components/checkmark-offblack.tsx +15 -0
- package/src/components/document-checkmark-duocolor.tsx +15 -0
- package/src/components/document-checkmark-offblack.tsx +15 -0
- package/src/components/getting-started-duocolor.tsx +15 -0
- package/src/components/getting-started-offblack.tsx +15 -0
- package/src/components/hand-heart-duocolor.tsx +15 -0
- package/src/components/hand-heart-offblack.tsx +15 -0
- package/src/components/id-error-duocolor.tsx +15 -0
- package/src/components/id-error-offblack.tsx +15 -0
- package/src/components/search-duocolor.tsx +15 -0
- package/src/components/search-field-duocolor.tsx +15 -0
- package/src/components/search-field-offblack.tsx +15 -0
- package/src/components/search-offblack.tsx +15 -0
- package/src/components/search-question-duocolor.tsx +15 -0
- package/src/components/search-question-offblack.tsx +15 -0
- package/src/components/settings-time-duocolor.tsx +15 -0
- package/src/components/settings-time-offblack.tsx +15 -0
- package/src/components/support-checkmark-duocolor.tsx +15 -0
- package/src/components/support-checkmark-offblack.tsx +15 -0
- package/src/components/technical-error-duocolor.tsx +15 -0
- package/src/components/technical-error-offblack.tsx +15 -0
- package/src/components/user-checkmark-duocolor.tsx +15 -0
- package/src/components/user-checkmark-offblack.tsx +15 -0
- package/src/components/user-error-duocolor.tsx +15 -0
- package/src/components/user-error-offblack.tsx +15 -0
- package/src/components/user-lock-duocolor.tsx +15 -0
- package/src/components/user-lock-offblack.tsx +15 -0
- package/src/components/user-plus-duocolor.tsx +15 -0
- package/src/components/user-plus-offblack.tsx +15 -0
- package/src/components/user-settings-duocolor.tsx +15 -0
- package/src/components/user-settings-offblack.tsx +15 -0
- package/src/global.d.ts +4 -0
- package/src/illustrative-icon.stories.tsx +123 -0
- package/src/illustrative-icon.test.tsx +43 -0
- package/src/illustrative-icon.tsx +90 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
|
|
4
|
+
import * as components from "./all-illustrative-icon-components";
|
|
5
|
+
import { IllustrativeIconSearchFieldDuocolor } from "./components/search-field-duocolor";
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: "Components/IllustrativeIcon",
|
|
9
|
+
component: IllustrativeIconSearchFieldDuocolor,
|
|
10
|
+
parameters: {
|
|
11
|
+
design: [
|
|
12
|
+
{
|
|
13
|
+
name: "IllustrativeIcon",
|
|
14
|
+
type: "figma",
|
|
15
|
+
url: "https://www.figma.com/design/pwHRVifi0TRqqn02OLJQrB/Illustrative-icons?node-id=0-1",
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
} satisfies Meta<typeof IllustrativeIconSearchFieldDuocolor>;
|
|
20
|
+
|
|
21
|
+
export default meta;
|
|
22
|
+
type Story = StoryObj<typeof IllustrativeIconSearchFieldDuocolor>;
|
|
23
|
+
|
|
24
|
+
export const Showcase: Story = {
|
|
25
|
+
parameters: {},
|
|
26
|
+
args: {
|
|
27
|
+
autoplay: true,
|
|
28
|
+
allyTitle: "search field animation",
|
|
29
|
+
"data-testid": "",
|
|
30
|
+
className: "",
|
|
31
|
+
},
|
|
32
|
+
argTypes: {},
|
|
33
|
+
|
|
34
|
+
render: ({ ...args }) => (
|
|
35
|
+
<div style={{ height: "200px", width: "200px" }}>
|
|
36
|
+
<IllustrativeIconSearchFieldDuocolor {...args} />
|
|
37
|
+
</div>
|
|
38
|
+
),
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const RenderComponent = ({ index }: { index: number }) => {
|
|
42
|
+
const [autoplay, setAutoplay] = useState(false);
|
|
43
|
+
const [name, Component] = Object.entries(components)[index];
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<button
|
|
47
|
+
onClick={() => setAutoplay(true)}
|
|
48
|
+
type="button"
|
|
49
|
+
style={{
|
|
50
|
+
all: "unset",
|
|
51
|
+
}}
|
|
52
|
+
>
|
|
53
|
+
<div
|
|
54
|
+
style={{
|
|
55
|
+
display: "flex",
|
|
56
|
+
flexDirection: "row",
|
|
57
|
+
alignItems: "center",
|
|
58
|
+
gap: 20,
|
|
59
|
+
}}
|
|
60
|
+
>
|
|
61
|
+
<div
|
|
62
|
+
style={{
|
|
63
|
+
display: "flex",
|
|
64
|
+
flexShrink: 0,
|
|
65
|
+
padding: 4,
|
|
66
|
+
background: "#fff",
|
|
67
|
+
borderRadius: 4,
|
|
68
|
+
border: "1px solid hsla(203, 50%, 30%, 0.15)",
|
|
69
|
+
boxShadow: "rgba(0, 0, 0, 0.10) 0 1px 3px 0",
|
|
70
|
+
width: "6rem",
|
|
71
|
+
height: "6rem",
|
|
72
|
+
}}
|
|
73
|
+
>
|
|
74
|
+
<Component autoplay={autoplay} onAnimationEnd={() => setAutoplay(false)} />
|
|
75
|
+
</div>
|
|
76
|
+
<p
|
|
77
|
+
style={{
|
|
78
|
+
margin: 0,
|
|
79
|
+
color: "#2E3438",
|
|
80
|
+
fontSize: 14,
|
|
81
|
+
lineHeight: 1.2,
|
|
82
|
+
fontFamily: "TeliaSans, Helvetica, Arial, 'Lucida Grande', sans-serif",
|
|
83
|
+
}}
|
|
84
|
+
>
|
|
85
|
+
{name.replace("IllustrativeIcon", "")}
|
|
86
|
+
</p>
|
|
87
|
+
</div>
|
|
88
|
+
</button>
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export const AllComponents: Story = {
|
|
93
|
+
parameters: {
|
|
94
|
+
docs: {
|
|
95
|
+
description: {
|
|
96
|
+
story: `To see the animations, click on the icons.
|
|
97
|
+
Use the icons in the following manner: \`<IllustrativeIconSearchFieldDuocolor />\` `,
|
|
98
|
+
},
|
|
99
|
+
source: {
|
|
100
|
+
code: `
|
|
101
|
+
<>
|
|
102
|
+
<IllustrativeIcon404ErrorDuocolor />
|
|
103
|
+
<IllustrativeIcon404ErrorOffblack />
|
|
104
|
+
<IllustrativeIconCartCheckmarkDuocolor />
|
|
105
|
+
...
|
|
106
|
+
</>`,
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
render: () => (
|
|
111
|
+
<div
|
|
112
|
+
style={{
|
|
113
|
+
display: "grid",
|
|
114
|
+
gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
|
|
115
|
+
gap: 20,
|
|
116
|
+
}}
|
|
117
|
+
>
|
|
118
|
+
{Object.entries(components).map(([name], index) => (
|
|
119
|
+
<RenderComponent key={name} index={index} />
|
|
120
|
+
))}
|
|
121
|
+
</div>
|
|
122
|
+
),
|
|
123
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import * as matchers from "@testing-library/jest-dom/matchers";
|
|
3
|
+
import { cleanup, render, screen } from "@testing-library/react";
|
|
4
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
5
|
+
import { axe } from "vitest-axe";
|
|
6
|
+
import * as axeMatchers from "vitest-axe/matchers";
|
|
7
|
+
|
|
8
|
+
import "vitest-canvas-mock";
|
|
9
|
+
import animationData from "./assets/404-error-duocolor.json";
|
|
10
|
+
import { IllustrativeIcon } from "./illustrative-icon";
|
|
11
|
+
|
|
12
|
+
expect.extend(matchers);
|
|
13
|
+
expect.extend(axeMatchers);
|
|
14
|
+
|
|
15
|
+
Object.defineProperty(window, "matchMedia", {
|
|
16
|
+
writable: true,
|
|
17
|
+
value: vi.fn().mockImplementation((query) => ({
|
|
18
|
+
matches: false,
|
|
19
|
+
media: query,
|
|
20
|
+
onchange: null,
|
|
21
|
+
addEventListener: vi.fn(),
|
|
22
|
+
removeEventListener: vi.fn(),
|
|
23
|
+
})),
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
describe("IllustrativeIcon", () => {
|
|
27
|
+
afterEach(() => {
|
|
28
|
+
cleanup();
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("basic test", () => {
|
|
32
|
+
render(<IllustrativeIcon data-testid="illustrative-icon" json={animationData} />);
|
|
33
|
+
expect(screen.getByTestId("illustrative-icon")).toBeInTheDocument();
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it("is accessible", async () => {
|
|
37
|
+
const { container } = render(<IllustrativeIcon json={animationData} />);
|
|
38
|
+
const results = await axe(container);
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
40
|
+
// @ts-ignore
|
|
41
|
+
expect(results).toHaveNoViolations();
|
|
42
|
+
});
|
|
43
|
+
});
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import React, { ForwardedRef, forwardRef, useEffect, useRef, useState } from "react";
|
|
2
|
+
import lottie, { AnimationItem } from "lottie-web/build/player/lottie_light";
|
|
3
|
+
|
|
4
|
+
export * from "./all-illustrative-icon-components";
|
|
5
|
+
|
|
6
|
+
export type IllustrativeBaseIconProps = {
|
|
7
|
+
["data-testid"]?: string;
|
|
8
|
+
allyTitle?: string;
|
|
9
|
+
autoplay?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
onAnimationEnd?: () => void;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type IllustrativeIconProps = {
|
|
15
|
+
json: object;
|
|
16
|
+
} & IllustrativeBaseIconProps;
|
|
17
|
+
|
|
18
|
+
export const IllustrativeIcon = forwardRef(
|
|
19
|
+
(
|
|
20
|
+
{
|
|
21
|
+
["data-testid"]: dataTestid,
|
|
22
|
+
allyTitle,
|
|
23
|
+
className,
|
|
24
|
+
json,
|
|
25
|
+
autoplay = true,
|
|
26
|
+
onAnimationEnd,
|
|
27
|
+
...props
|
|
28
|
+
}: IllustrativeIconProps,
|
|
29
|
+
ref: ForwardedRef<HTMLDivElement>
|
|
30
|
+
) => {
|
|
31
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
32
|
+
const animationRef = useRef<AnimationItem | null>(null);
|
|
33
|
+
const [reduceMotion, setReduceMotion] = useState(false);
|
|
34
|
+
|
|
35
|
+
const classes = className;
|
|
36
|
+
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
38
|
+
const handleReduceMotionChange = (event: any) => {
|
|
39
|
+
setReduceMotion(event.matches);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
const mediaQuery = window.matchMedia("(prefers-reduced-motion)");
|
|
44
|
+
|
|
45
|
+
setReduceMotion(mediaQuery.matches);
|
|
46
|
+
|
|
47
|
+
mediaQuery.addEventListener("change", handleReduceMotionChange);
|
|
48
|
+
|
|
49
|
+
return () => {
|
|
50
|
+
mediaQuery.removeEventListener("change", handleReduceMotionChange);
|
|
51
|
+
};
|
|
52
|
+
}, []);
|
|
53
|
+
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
if (containerRef.current) {
|
|
56
|
+
animationRef.current = lottie.loadAnimation({
|
|
57
|
+
container: containerRef.current,
|
|
58
|
+
renderer: "svg",
|
|
59
|
+
loop: false,
|
|
60
|
+
autoplay: !reduceMotion && autoplay,
|
|
61
|
+
animationData: json,
|
|
62
|
+
rendererSettings: {
|
|
63
|
+
preserveAspectRatio: "xMidYMid slice",
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
animationRef.current.addEventListener("complete", () => {
|
|
68
|
+
onAnimationEnd?.();
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
if ((reduceMotion || !autoplay) && animationRef.current) {
|
|
72
|
+
const totalFrames = animationRef.current.getDuration(true);
|
|
73
|
+
animationRef.current.goToAndStop(totalFrames - 1, true);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return () => {
|
|
78
|
+
animationRef.current?.destroy();
|
|
79
|
+
};
|
|
80
|
+
}, [reduceMotion, json, autoplay, onAnimationEnd]);
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<div aria-label={allyTitle} data-testid={dataTestid} ref={ref} className={classes} {...props}>
|
|
84
|
+
<div ref={containerRef} />
|
|
85
|
+
</div>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
IllustrativeIcon.displayName = "IllustrativeIcon";
|