@wordpress/components 32.2.1-next.v.202602191100.0 → 32.2.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/CHANGELOG.md +35 -0
- package/build/alignment-matrix-control/cell.cjs +2 -2
- package/build/alignment-matrix-control/cell.cjs.map +1 -1
- package/build/alignment-matrix-control/index.cjs +2 -2
- package/build/alignment-matrix-control/index.cjs.map +1 -1
- package/build/angle-picker-control/angle-circle.cjs +2 -2
- package/build/angle-picker-control/angle-circle.cjs.map +1 -1
- package/build/autocomplete/index.cjs +15 -7
- package/build/autocomplete/index.cjs.map +2 -2
- package/build/date-time/time/index.cjs +1 -1
- package/build/date-time/time/index.cjs.map +2 -2
- package/build/date-time/utils.cjs +9 -0
- package/build/date-time/utils.cjs.map +2 -2
- package/build/private-apis.cjs +0 -4
- package/build/private-apis.cjs.map +3 -3
- package/build/sandbox/index.cjs +125 -1
- package/build/sandbox/index.cjs.map +2 -2
- package/build/select-control/styles/select-control-styles.cjs +8 -8
- package/build/select-control/styles/select-control-styles.cjs.map +2 -2
- package/build/snackbar/list.cjs +4 -1
- package/build/snackbar/list.cjs.map +2 -2
- package/build/toggle-group-control/toggle-group-control-option-base/styles.cjs +8 -8
- package/build/toggle-group-control/toggle-group-control-option-base/styles.cjs.map +2 -2
- package/build/validated-form-controls/control-with-error.cjs +26 -3
- package/build/validated-form-controls/control-with-error.cjs.map +2 -2
- package/build/validated-form-controls/validity-indicator.cjs +2 -0
- package/build/validated-form-controls/validity-indicator.cjs.map +2 -2
- package/build-module/alignment-matrix-control/cell.mjs +2 -2
- package/build-module/alignment-matrix-control/cell.mjs.map +1 -1
- package/build-module/alignment-matrix-control/index.mjs +2 -2
- package/build-module/alignment-matrix-control/index.mjs.map +1 -1
- package/build-module/angle-picker-control/angle-circle.mjs +2 -2
- package/build-module/angle-picker-control/angle-circle.mjs.map +1 -1
- package/build-module/autocomplete/index.mjs +13 -6
- package/build-module/autocomplete/index.mjs.map +2 -2
- package/build-module/date-time/time/index.mjs +2 -2
- package/build-module/date-time/time/index.mjs.map +2 -2
- package/build-module/date-time/utils.mjs +8 -0
- package/build-module/date-time/utils.mjs.map +2 -2
- package/build-module/private-apis.mjs +0 -4
- package/build-module/private-apis.mjs.map +2 -2
- package/build-module/sandbox/index.mjs +126 -2
- package/build-module/sandbox/index.mjs.map +2 -2
- package/build-module/select-control/styles/select-control-styles.mjs +8 -8
- package/build-module/select-control/styles/select-control-styles.mjs.map +2 -2
- package/build-module/snackbar/list.mjs +4 -1
- package/build-module/snackbar/list.mjs.map +2 -2
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.mjs +8 -8
- package/build-module/toggle-group-control/toggle-group-control-option-base/styles.mjs.map +2 -2
- package/build-module/validated-form-controls/control-with-error.mjs +27 -4
- package/build-module/validated-form-controls/control-with-error.mjs.map +2 -2
- package/build-module/validated-form-controls/validity-indicator.mjs +2 -0
- package/build-module/validated-form-controls/validity-indicator.mjs.map +2 -2
- package/build-style/style-rtl.css +7 -183
- package/build-style/style.css +7 -183
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts +19 -0
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts.map +1 -0
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts +23 -0
- package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts.map +1 -0
- package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts +25 -0
- package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts.map +1 -0
- package/build-types/autocomplete/get-autocomplete-match.d.ts +20 -0
- package/build-types/autocomplete/get-autocomplete-match.d.ts.map +1 -0
- package/build-types/autocomplete/index.d.ts +8 -0
- package/build-types/autocomplete/index.d.ts.map +1 -1
- package/build-types/autocomplete/test/get-autocomplete-match.d.ts +2 -0
- package/build-types/autocomplete/test/get-autocomplete-match.d.ts.map +1 -0
- package/build-types/badge/stories/e2e/index.story.d.ts +7 -0
- package/build-types/badge/stories/e2e/index.story.d.ts.map +1 -0
- package/build-types/border-control/border-control-style-picker/hook.d.ts +267 -0
- package/build-types/border-control/border-control-style-picker/hook.d.ts.map +1 -0
- package/build-types/box-control/all-input-control.d.ts +4 -0
- package/build-types/box-control/all-input-control.d.ts.map +1 -0
- package/build-types/box-control/axial-input-controls.d.ts +4 -0
- package/build-types/box-control/axial-input-controls.d.ts.map +1 -0
- package/build-types/box-control/input-controls.d.ts +4 -0
- package/build-types/box-control/input-controls.d.ts.map +1 -0
- package/build-types/box-control/styles/box-control-visualizer-styles.d.ts +46 -0
- package/build-types/box-control/styles/box-control-visualizer-styles.d.ts.map +1 -0
- package/build-types/box-control/unit-control.d.ts +4 -0
- package/build-types/box-control/unit-control.d.ts.map +1 -0
- package/build-types/custom-gradient-picker/test/index.d.ts +2 -0
- package/build-types/custom-gradient-picker/test/index.d.ts.map +1 -0
- package/build-types/custom-select-control/styles.d.ts +11 -0
- package/build-types/custom-select-control/styles.d.ts.map +1 -0
- package/build-types/date-time/date-picker/index.d.ts +23 -0
- package/build-types/date-time/date-picker/index.d.ts.map +1 -0
- package/build-types/date-time/date-picker/styles.d.ts +45 -0
- package/build-types/date-time/date-picker/styles.d.ts.map +1 -0
- package/build-types/date-time/date-picker/test/index.d.ts +2 -0
- package/build-types/date-time/date-picker/test/index.d.ts.map +1 -0
- package/build-types/date-time/date-picker/test/use-lilius.d.ts +2 -0
- package/build-types/date-time/date-picker/test/use-lilius.d.ts.map +1 -0
- package/build-types/date-time/date-picker/use-lilius/index.d.ts +169 -0
- package/build-types/date-time/date-picker/use-lilius/index.d.ts.map +1 -0
- package/build-types/date-time/time/index.d.ts.map +1 -1
- package/build-types/date-time/time-picker/index.d.ts +27 -0
- package/build-types/date-time/time-picker/index.d.ts.map +1 -0
- package/build-types/date-time/time-picker/styles.d.ts +93 -0
- package/build-types/date-time/time-picker/styles.d.ts.map +1 -0
- package/build-types/date-time/time-picker/test/index.d.ts +2 -0
- package/build-types/date-time/time-picker/test/index.d.ts.map +1 -0
- package/build-types/date-time/time-picker/time-input/index.d.ts +4 -0
- package/build-types/date-time/time-picker/time-input/index.d.ts.map +1 -0
- package/build-types/date-time/time-picker/time-input/test/index.d.ts +2 -0
- package/build-types/date-time/time-picker/time-input/test/index.d.ts.map +1 -0
- package/build-types/date-time/time-picker/timezone.d.ts +7 -0
- package/build-types/date-time/time-picker/timezone.d.ts.map +1 -0
- package/build-types/date-time/utils.d.ts +9 -0
- package/build-types/date-time/utils.d.ts.map +1 -1
- package/build-types/dimension-control/index.d.ts +28 -0
- package/build-types/dimension-control/index.d.ts.map +1 -0
- package/build-types/dimension-control/sizes.d.ts +26 -0
- package/build-types/dimension-control/sizes.d.ts.map +1 -0
- package/build-types/dimension-control/stories/index.story.d.ts +4 -0
- package/build-types/dimension-control/stories/index.story.d.ts.map +1 -0
- package/build-types/dimension-control/types.d.ts +47 -0
- package/build-types/dimension-control/types.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/index.d.ts +17 -0
- package/build-types/dropdown-menu-v2/index.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/stories/index.story.d.ts +11 -0
- package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/styles.d.ts +42 -0
- package/build-types/dropdown-menu-v2/styles.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/test/index.d.ts +2 -0
- package/build-types/dropdown-menu-v2/test/index.d.ts.map +1 -0
- package/build-types/dropdown-menu-v2/types.d.ts +252 -0
- package/build-types/dropdown-menu-v2/types.d.ts.map +1 -0
- package/build-types/external-link/styles/external-link-styles.d.ts +10 -0
- package/build-types/external-link/styles/external-link-styles.d.ts.map +1 -0
- package/build-types/mobile/inserter-button/sparkles.d.ts +3 -0
- package/build-types/mobile/inserter-button/sparkles.d.ts.map +1 -0
- package/build-types/navigator/navigator-back-button/index.d.ts +2 -0
- package/build-types/navigator/navigator-back-button/index.d.ts.map +1 -0
- package/build-types/navigator/navigator-button/index.d.ts +2 -0
- package/build-types/navigator/navigator-button/index.d.ts.map +1 -0
- package/build-types/navigator/navigator-provider/component.d.ts +38 -0
- package/build-types/navigator/navigator-provider/component.d.ts.map +1 -0
- package/build-types/navigator/navigator-provider/index.d.ts +2 -0
- package/build-types/navigator/navigator-provider/index.d.ts.map +1 -0
- package/build-types/navigator/navigator-screen/index.d.ts +2 -0
- package/build-types/navigator/navigator-screen/index.d.ts.map +1 -0
- package/build-types/navigator/navigator-to-parent-button/index.d.ts +2 -0
- package/build-types/navigator/navigator-to-parent-button/index.d.ts.map +1 -0
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/radio-group/radio/index.d.ts +7 -0
- package/build-types/radio-group/radio/index.d.ts.map +1 -0
- package/build-types/radio-group/radio-context/index.d.ts +6 -0
- package/build-types/radio-group/radio-context/index.d.ts.map +1 -0
- package/build-types/sandbox/index.d.ts +1 -1
- package/build-types/sandbox/index.d.ts.map +1 -1
- package/build-types/sandbox/types.d.ts +11 -0
- package/build-types/sandbox/types.d.ts.map +1 -1
- package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
- package/build-types/slot-fill/bubbles-virtually/fill.d.ts +5 -0
- package/build-types/slot-fill/bubbles-virtually/fill.d.ts.map +1 -0
- package/build-types/slot-fill/bubbles-virtually/slot-fill-context.d.ts +12 -0
- package/build-types/slot-fill/bubbles-virtually/slot-fill-context.d.ts.map +1 -0
- package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts +4 -0
- package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -0
- package/build-types/slot-fill/use-slot.d.ts +9 -0
- package/build-types/slot-fill/use-slot.d.ts.map +1 -0
- package/build-types/snackbar/list.d.ts.map +1 -1
- package/build-types/style-provider/test/index.d.ts +2 -0
- package/build-types/style-provider/test/index.d.ts.map +1 -0
- package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
- package/build-types/ui/context/constants.d.ts +8 -0
- package/build-types/ui/context/constants.d.ts.map +1 -0
- package/build-types/ui/context/context-connect.d.ts +40 -0
- package/build-types/ui/context/context-connect.d.ts.map +1 -0
- package/build-types/ui/context/context-system-provider.d.ts +7 -0
- package/build-types/ui/context/context-system-provider.d.ts.map +1 -0
- package/build-types/ui/context/get-styled-class-name-from-key.d.ts +2 -0
- package/build-types/ui/context/get-styled-class-name-from-key.d.ts.map +1 -0
- package/build-types/ui/context/index.d.ts +5 -0
- package/build-types/ui/context/index.d.ts.map +1 -0
- package/build-types/ui/context/test/context-connect.d.ts +2 -0
- package/build-types/ui/context/test/context-connect.d.ts.map +1 -0
- package/build-types/ui/context/test/wordpress-component.d.ts +2 -0
- package/build-types/ui/context/test/wordpress-component.d.ts.map +1 -0
- package/build-types/ui/context/use-context-system.d.ts +20 -0
- package/build-types/ui/context/use-context-system.d.ts.map +1 -0
- package/build-types/ui/context/utils.d.ts +26 -0
- package/build-types/ui/context/utils.d.ts.map +1 -0
- package/build-types/ui/context/wordpress-component.d.ts +32 -0
- package/build-types/ui/context/wordpress-component.d.ts.map +1 -0
- package/build-types/ui/shortcut/component.d.ts +12 -0
- package/build-types/ui/shortcut/component.d.ts.map +1 -0
- package/build-types/ui/shortcut/index.d.ts +3 -0
- package/build-types/ui/shortcut/index.d.ts.map +1 -0
- package/build-types/ui/tooltip/component.d.ts +29 -0
- package/build-types/ui/tooltip/component.d.ts.map +1 -0
- package/build-types/ui/tooltip/content.d.ts +9 -0
- package/build-types/ui/tooltip/content.d.ts.map +1 -0
- package/build-types/ui/tooltip/context.d.ts +10 -0
- package/build-types/ui/tooltip/context.d.ts.map +1 -0
- package/build-types/ui/tooltip/index.d.ts +3 -0
- package/build-types/ui/tooltip/index.d.ts.map +1 -0
- package/build-types/ui/tooltip/styles.d.ts +12 -0
- package/build-types/ui/tooltip/styles.d.ts.map +1 -0
- package/build-types/ui/tooltip/types.d.ts +62 -0
- package/build-types/ui/tooltip/types.d.ts.map +1 -0
- package/build-types/ui/utils/colors.d.ts +17 -0
- package/build-types/ui/utils/colors.d.ts.map +1 -0
- package/build-types/ui/utils/font-size.d.ts +18 -0
- package/build-types/ui/utils/font-size.d.ts.map +1 -0
- package/build-types/ui/utils/get-valid-children.d.ts +13 -0
- package/build-types/ui/utils/get-valid-children.d.ts.map +1 -0
- package/build-types/ui/utils/index.d.ts +2 -0
- package/build-types/ui/utils/index.d.ts.map +1 -0
- package/build-types/ui/utils/space.d.ts +23 -0
- package/build-types/ui/utils/space.d.ts.map +1 -0
- package/build-types/ui/utils/types.d.ts +14 -0
- package/build-types/ui/utils/types.d.ts.map +1 -0
- package/build-types/ui/utils/use-responsive-value.d.ts +5 -0
- package/build-types/ui/utils/use-responsive-value.d.ts.map +1 -0
- package/build-types/utils/hooks/use-latest-ref.d.ts +15 -0
- package/build-types/utils/hooks/use-latest-ref.d.ts.map +1 -0
- package/build-types/utils/input/base.d.ts +3 -0
- package/build-types/utils/input/base.d.ts.map +1 -0
- package/build-types/utils/input/index.d.ts +2 -0
- package/build-types/utils/input/index.d.ts.map +1 -0
- package/build-types/utils/input/input-control.d.ts +2 -0
- package/build-types/utils/input/input-control.d.ts.map +1 -0
- package/build-types/utils/reduce-motion.d.ts +8 -0
- package/build-types/utils/reduce-motion.d.ts.map +1 -0
- package/build-types/utils/z-index.d.ts +3 -0
- package/build-types/utils/z-index.d.ts.map +1 -0
- package/build-types/validated-form-controls/control-with-error.d.ts.map +1 -1
- package/build-types/validated-form-controls/test/checkbox-control.d.ts +2 -0
- package/build-types/validated-form-controls/test/checkbox-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/test/combobox-control.d.ts +2 -0
- package/build-types/validated-form-controls/test/combobox-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/test/custom-select-control.d.ts +2 -0
- package/build-types/validated-form-controls/test/custom-select-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/test/form-token-field.d.ts +2 -0
- package/build-types/validated-form-controls/test/form-token-field.d.ts.map +1 -0
- package/build-types/validated-form-controls/test/input-control.d.ts +2 -0
- package/build-types/validated-form-controls/test/input-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/test/number-control.d.ts +2 -0
- package/build-types/validated-form-controls/test/number-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/test/radio-control.d.ts +2 -0
- package/build-types/validated-form-controls/test/radio-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/test/range-control.d.ts +2 -0
- package/build-types/validated-form-controls/test/range-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/test/select-control.d.ts +2 -0
- package/build-types/validated-form-controls/test/select-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/test/text-control.d.ts +2 -0
- package/build-types/validated-form-controls/test/text-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/test/textarea-control.d.ts +2 -0
- package/build-types/validated-form-controls/test/textarea-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/test/toggle-control.d.ts +2 -0
- package/build-types/validated-form-controls/test/toggle-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/test/toggle-group-control.d.ts +2 -0
- package/build-types/validated-form-controls/test/toggle-group-control.d.ts.map +1 -0
- package/build-types/validated-form-controls/validity-indicator.d.ts +2 -1
- package/build-types/validated-form-controls/validity-indicator.d.ts.map +1 -1
- package/build-types/view/types.d.ts +8 -0
- package/build-types/view/types.d.ts.map +1 -0
- package/package.json +21 -21
- package/src/autocomplete/index.tsx +30 -6
- package/src/autocomplete/test/index.tsx +110 -1
- package/src/button/style.scss +8 -5
- package/src/date-time/test/utils.test.ts +8 -11
- package/src/date-time/time/index.tsx +2 -12
- package/src/date-time/time/test/index.tsx +69 -0
- package/src/date-time/utils.ts +18 -0
- package/src/form-token-field/style.scss +1 -0
- package/src/private-apis.ts +0 -4
- package/src/sandbox/index.tsx +189 -9
- package/src/sandbox/test/index.tsx +65 -24
- package/src/sandbox/types.ts +11 -0
- package/src/select-control/styles/select-control-styles.ts +1 -0
- package/src/snackbar/list.tsx +6 -1
- package/src/style.scss +0 -2
- package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +18 -16
- package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +4 -6
- package/src/validated-form-controls/control-with-error.tsx +44 -4
- package/src/validated-form-controls/test/checkbox-control.tsx +49 -0
- package/src/validated-form-controls/test/combobox-control.tsx +61 -0
- package/src/validated-form-controls/test/control-with-error.tsx +182 -1
- package/src/validated-form-controls/test/custom-select-control.tsx +60 -0
- package/src/validated-form-controls/test/form-token-field.tsx +52 -0
- package/src/validated-form-controls/test/input-control.tsx +42 -0
- package/src/validated-form-controls/test/number-control.tsx +44 -0
- package/src/validated-form-controls/test/radio-control.tsx +61 -0
- package/src/validated-form-controls/test/range-control.tsx +73 -0
- package/src/validated-form-controls/test/select-control.tsx +57 -0
- package/src/validated-form-controls/test/text-control.tsx +49 -0
- package/src/validated-form-controls/test/textarea-control.tsx +51 -0
- package/src/validated-form-controls/test/toggle-control.tsx +49 -0
- package/src/validated-form-controls/test/toggle-group-control.tsx +28 -0
- package/src/validated-form-controls/validity-indicator.tsx +3 -0
- package/build/avatar/component.cjs +0 -99
- package/build/avatar/component.cjs.map +0 -7
- package/build/avatar/index.cjs +0 -37
- package/build/avatar/index.cjs.map +0 -7
- package/build/avatar/types.cjs +0 -19
- package/build/avatar/types.cjs.map +0 -7
- package/build/avatar-group/component.cjs +0 -60
- package/build/avatar-group/component.cjs.map +0 -7
- package/build/avatar-group/index.cjs +0 -37
- package/build/avatar-group/index.cjs.map +0 -7
- package/build/avatar-group/types.cjs +0 -19
- package/build/avatar-group/types.cjs.map +0 -7
- package/build-module/avatar/component.mjs +0 -68
- package/build-module/avatar/component.mjs.map +0 -7
- package/build-module/avatar/index.mjs +0 -6
- package/build-module/avatar/index.mjs.map +0 -7
- package/build-module/avatar/types.mjs +0 -1
- package/build-module/avatar/types.mjs.map +0 -7
- package/build-module/avatar-group/component.mjs +0 -29
- package/build-module/avatar-group/component.mjs.map +0 -7
- package/build-module/avatar-group/index.mjs +0 -6
- package/build-module/avatar-group/index.mjs.map +0 -7
- package/build-module/avatar-group/types.mjs +0 -1
- package/build-module/avatar-group/types.mjs.map +0 -7
- package/build-types/avatar/component.d.ts +0 -5
- package/build-types/avatar/component.d.ts.map +0 -1
- package/build-types/avatar/index.d.ts +0 -3
- package/build-types/avatar/index.d.ts.map +0 -1
- package/build-types/avatar/types.d.ts +0 -59
- package/build-types/avatar/types.d.ts.map +0 -1
- package/build-types/avatar-group/component.d.ts +0 -8
- package/build-types/avatar-group/component.d.ts.map +0 -1
- package/build-types/avatar-group/index.d.ts +0 -3
- package/build-types/avatar-group/index.d.ts.map +0 -1
- package/build-types/avatar-group/types.d.ts +0 -14
- package/build-types/avatar-group/types.d.ts.map +0 -1
- package/src/avatar/component.tsx +0 -82
- package/src/avatar/index.ts +0 -2
- package/src/avatar/styles.scss +0 -152
- package/src/avatar/types.ts +0 -59
- package/src/avatar-group/component.tsx +0 -46
- package/src/avatar-group/index.ts +0 -2
- package/src/avatar-group/styles.scss +0 -32
- package/src/avatar-group/types.ts +0 -13
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=types.mjs.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { AvatarProps } from './types';
|
|
2
|
-
import type { WordPressComponentProps } from '../context';
|
|
3
|
-
declare function Avatar({ className, src, name, label, badge, size, borderColor, status, statusIndicator, style, ...props }: WordPressComponentProps<AvatarProps, 'div', false>): import("react").JSX.Element;
|
|
4
|
-
export default Avatar;
|
|
5
|
-
//# sourceMappingURL=component.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/avatar/component.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE1D,iBAAS,MAAM,CAAE,EAChB,SAAS,EACT,GAAG,EACH,IAAI,EACJ,KAAK,EACL,KAAa,EACb,IAAgB,EAChB,WAAW,EACX,MAAM,EACN,eAAe,EACf,KAAK,EACL,GAAG,KAAK,EACR,EAAE,uBAAuB,CAAE,WAAW,EAAE,KAAK,EAAE,KAAK,CAAE,+BAsDtD;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/avatar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import type { IconType } from '../icon';
|
|
2
|
-
export type AvatarProps = {
|
|
3
|
-
/**
|
|
4
|
-
* URL of the avatar image.
|
|
5
|
-
*
|
|
6
|
-
* When not provided, initials derived from `name` are shown.
|
|
7
|
-
*/
|
|
8
|
-
src?: string;
|
|
9
|
-
/**
|
|
10
|
-
* Name of the user. Used as an accessible label and to generate
|
|
11
|
-
* initials when no image is provided.
|
|
12
|
-
*/
|
|
13
|
-
name?: string;
|
|
14
|
-
/**
|
|
15
|
-
* Visible text shown in the hover badge. When not provided, `name`
|
|
16
|
-
* is used instead. Use this to provide contextual labels like "You"
|
|
17
|
-
* without affecting the accessible name or initials.
|
|
18
|
-
*/
|
|
19
|
-
label?: string;
|
|
20
|
-
/**
|
|
21
|
-
* Whether to show the hover-expand badge that reveals the user's
|
|
22
|
-
* name (or `label`) on hover. Requires `name` to be set.
|
|
23
|
-
*
|
|
24
|
-
* @default false
|
|
25
|
-
*/
|
|
26
|
-
badge?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Size of the avatar.
|
|
29
|
-
*
|
|
30
|
-
* - `'default'`: 32px
|
|
31
|
-
* - `'small'`: 24px
|
|
32
|
-
*
|
|
33
|
-
* @default 'default'
|
|
34
|
-
*/
|
|
35
|
-
size?: 'default' | 'small';
|
|
36
|
-
/**
|
|
37
|
-
* CSS color value for an accent border ring around the avatar.
|
|
38
|
-
*
|
|
39
|
-
* When not provided, no border is rendered and the hover badge
|
|
40
|
-
* and avatar status uses the admin theme color as its background.
|
|
41
|
-
*/
|
|
42
|
-
borderColor?: string;
|
|
43
|
-
/**
|
|
44
|
-
* A status string applied to the avatar. When set, the image is
|
|
45
|
-
* dimmed to indicate a non-default state. A corresponding
|
|
46
|
-
* `is-{status}` class is added for custom styling.
|
|
47
|
-
*/
|
|
48
|
-
status?: string;
|
|
49
|
-
/**
|
|
50
|
-
* An icon or custom component rendered as a centered overlay on the
|
|
51
|
-
* avatar image. Only visible when `status` is set.
|
|
52
|
-
*
|
|
53
|
-
* Accepts any value supported by the `Icon` component: an icon from
|
|
54
|
-
* `@wordpress/icons`, a Dashicon name string, a component, or a
|
|
55
|
-
* JSX element.
|
|
56
|
-
*/
|
|
57
|
-
statusIndicator?: IconType | null;
|
|
58
|
-
};
|
|
59
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/avatar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,MAAM,WAAW,GAAG;IACzB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC3B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CAClC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Internal dependencies
|
|
3
|
-
*/
|
|
4
|
-
import type { AvatarGroupProps } from './types';
|
|
5
|
-
import type { WordPressComponentProps } from '../context';
|
|
6
|
-
declare function AvatarGroup({ className, max, children, ...props }: WordPressComponentProps<AvatarGroupProps, 'div', false>): import("react").JSX.Element;
|
|
7
|
-
export default AvatarGroup;
|
|
8
|
-
//# sourceMappingURL=component.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/avatar-group/component.tsx"],"names":[],"mappings":"AAUA;;GAEG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE1D,iBAAS,WAAW,CAAE,EACrB,SAAS,EACT,GAAO,EACP,QAAQ,EACR,GAAG,KAAK,EACR,EAAE,uBAAuB,CAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,CAAE,+BAsB3D;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/avatar-group/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export type AvatarGroupProps = {
|
|
2
|
-
/**
|
|
3
|
-
* Maximum number of avatars to display before showing an
|
|
4
|
-
* overflow indicator.
|
|
5
|
-
*
|
|
6
|
-
* @default 3
|
|
7
|
-
*/
|
|
8
|
-
max?: number;
|
|
9
|
-
/**
|
|
10
|
-
* Avatar elements to display in the group.
|
|
11
|
-
*/
|
|
12
|
-
children: React.ReactNode;
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/avatar-group/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC9B;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B,CAAC"}
|
package/src/avatar/component.tsx
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import clsx from 'clsx';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
|
-
import Icon from '../icon';
|
|
10
|
-
import Tooltip from '../tooltip';
|
|
11
|
-
import type { AvatarProps } from './types';
|
|
12
|
-
import type { WordPressComponentProps } from '../context';
|
|
13
|
-
|
|
14
|
-
function Avatar( {
|
|
15
|
-
className,
|
|
16
|
-
src,
|
|
17
|
-
name,
|
|
18
|
-
label,
|
|
19
|
-
badge = false,
|
|
20
|
-
size = 'default',
|
|
21
|
-
borderColor,
|
|
22
|
-
status,
|
|
23
|
-
statusIndicator,
|
|
24
|
-
style,
|
|
25
|
-
...props
|
|
26
|
-
}: WordPressComponentProps< AvatarProps, 'div', false > ) {
|
|
27
|
-
const showBadge = badge && !! name;
|
|
28
|
-
const initials = name
|
|
29
|
-
? name
|
|
30
|
-
.split( /\s+/ )
|
|
31
|
-
.slice( 0, 2 )
|
|
32
|
-
.map( ( word ) => word[ 0 ] )
|
|
33
|
-
.join( '' )
|
|
34
|
-
.toUpperCase()
|
|
35
|
-
: undefined;
|
|
36
|
-
const customProperties = {
|
|
37
|
-
...style,
|
|
38
|
-
...( src ? { '--components-avatar-url': `url(${ src })` } : {} ),
|
|
39
|
-
...( borderColor
|
|
40
|
-
? { '--components-avatar-outline-color': borderColor }
|
|
41
|
-
: {} ),
|
|
42
|
-
} as React.CSSProperties;
|
|
43
|
-
|
|
44
|
-
const avatar = (
|
|
45
|
-
<div
|
|
46
|
-
className={ clsx( 'components-avatar', className, {
|
|
47
|
-
'has-avatar-border-color': !! borderColor,
|
|
48
|
-
'has-src': !! src,
|
|
49
|
-
'has-badge': showBadge,
|
|
50
|
-
'is-small': size === 'small',
|
|
51
|
-
'has-status': !! status,
|
|
52
|
-
[ `is-${ status }` ]: !! status,
|
|
53
|
-
} ) }
|
|
54
|
-
style={ customProperties }
|
|
55
|
-
role="img"
|
|
56
|
-
aria-label={ name }
|
|
57
|
-
{ ...props }
|
|
58
|
-
>
|
|
59
|
-
<span className="components-avatar__image">
|
|
60
|
-
{ ! src && initials }
|
|
61
|
-
{ !! status && !! statusIndicator && (
|
|
62
|
-
<span className="components-avatar__status-indicator">
|
|
63
|
-
<Icon icon={ statusIndicator } />
|
|
64
|
-
</span>
|
|
65
|
-
) }
|
|
66
|
-
</span>
|
|
67
|
-
{ showBadge && (
|
|
68
|
-
<span className="components-avatar__name">
|
|
69
|
-
{ label || name }
|
|
70
|
-
</span>
|
|
71
|
-
) }
|
|
72
|
-
</div>
|
|
73
|
-
);
|
|
74
|
-
|
|
75
|
-
if ( name && ( ! showBadge || label ) ) {
|
|
76
|
-
return <Tooltip text={ name }>{ avatar }</Tooltip>;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return avatar;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export default Avatar;
|
package/src/avatar/index.ts
DELETED
package/src/avatar/styles.scss
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
@use "@wordpress/base-styles/colors" as *;
|
|
2
|
-
@use "@wordpress/base-styles/variables" as *;
|
|
3
|
-
@use "../utils/theme-variables" as *;
|
|
4
|
-
|
|
5
|
-
.components-avatar {
|
|
6
|
-
display: inline-flex;
|
|
7
|
-
align-items: center;
|
|
8
|
-
border-radius: $radius-full;
|
|
9
|
-
overflow: clip;
|
|
10
|
-
flex-shrink: 0;
|
|
11
|
-
background-color: $components-color-accent;
|
|
12
|
-
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) $white, $elevation-x-small;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.components-avatar__image {
|
|
16
|
-
box-sizing: border-box;
|
|
17
|
-
position: relative;
|
|
18
|
-
width: $button-size-compact;
|
|
19
|
-
height: $button-size-compact;
|
|
20
|
-
border-radius: $radius-full;
|
|
21
|
-
border: 0;
|
|
22
|
-
background-color: $components-color-accent;
|
|
23
|
-
overflow: clip;
|
|
24
|
-
flex-shrink: 0;
|
|
25
|
-
font-size: 0;
|
|
26
|
-
color: $white;
|
|
27
|
-
|
|
28
|
-
.is-small > & {
|
|
29
|
-
width: $button-size-small;
|
|
30
|
-
height: $button-size-small;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.has-src > & {
|
|
34
|
-
background-image: var(--components-avatar-url);
|
|
35
|
-
background-size: cover;
|
|
36
|
-
background-position: center;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.has-avatar-border-color > & {
|
|
40
|
-
border: var(--wp-admin-border-width-focus) solid var(--components-avatar-outline-color);
|
|
41
|
-
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) $white;
|
|
42
|
-
background-clip: padding-box;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Initials fallback: show name characters when no image.
|
|
47
|
-
.components-avatar:not(.has-src) > .components-avatar__image {
|
|
48
|
-
display: flex;
|
|
49
|
-
align-items: center;
|
|
50
|
-
justify-content: center;
|
|
51
|
-
font-size: $font-size-x-small;
|
|
52
|
-
font-weight: $font-weight-medium;
|
|
53
|
-
border: 0;
|
|
54
|
-
box-shadow: none;
|
|
55
|
-
background-clip: border-box;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.components-avatar:not(.has-src).has-avatar-border-color > .components-avatar__image {
|
|
59
|
-
background-color: var(--components-avatar-outline-color);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.components-avatar__name {
|
|
63
|
-
font-size: $font-size-medium;
|
|
64
|
-
line-height: $font-line-height-small;
|
|
65
|
-
color: $white;
|
|
66
|
-
min-width: 0;
|
|
67
|
-
padding-bottom: calc($grid-unit-05 / 2);
|
|
68
|
-
overflow: hidden;
|
|
69
|
-
opacity: 0;
|
|
70
|
-
white-space: nowrap;
|
|
71
|
-
transition: opacity 0.15s cubic-bezier(0.15, 0, 0.15, 1);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// Badge mode: use grid so the name column animates from 0 to natural width.
|
|
75
|
-
// Spacing is on the container (column-gap + padding-inline-end) so it
|
|
76
|
-
// transitions alongside grid-template-columns instead of causing a bump.
|
|
77
|
-
.components-avatar.has-badge {
|
|
78
|
-
display: inline-grid;
|
|
79
|
-
grid-template-columns: min-content 0fr;
|
|
80
|
-
column-gap: 0;
|
|
81
|
-
padding-inline-end: 0;
|
|
82
|
-
transition:
|
|
83
|
-
grid-template-columns 0.3s cubic-bezier(0.15, 0, 0.15, 1),
|
|
84
|
-
column-gap 0.3s cubic-bezier(0.15, 0, 0.15, 1),
|
|
85
|
-
padding-inline-end 0.3s cubic-bezier(0.15, 0, 0.15, 1);
|
|
86
|
-
|
|
87
|
-
&:hover {
|
|
88
|
-
grid-template-columns: min-content 1fr;
|
|
89
|
-
column-gap: $grid-unit-05;
|
|
90
|
-
padding-inline-end: $grid-unit-10;
|
|
91
|
-
transition-timing-function: cubic-bezier(0.85, 0, 0.85, 1);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
&:hover .components-avatar__name {
|
|
95
|
-
opacity: 1;
|
|
96
|
-
transition-timing-function: cubic-bezier(0.85, 0, 0.85, 1);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.components-avatar.has-badge.has-avatar-border-color {
|
|
101
|
-
background-color: var(--components-avatar-outline-color);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// Status: dim and desaturate content so the background color shows through.
|
|
105
|
-
// Images: move to ::before with luminosity blend over the solid bg color.
|
|
106
|
-
// Initials: reduce text opacity.
|
|
107
|
-
.components-avatar.has-status.has-src > .components-avatar__image {
|
|
108
|
-
background-image: none;
|
|
109
|
-
|
|
110
|
-
&::before {
|
|
111
|
-
content: "";
|
|
112
|
-
position: absolute;
|
|
113
|
-
inset: 0;
|
|
114
|
-
border-radius: inherit;
|
|
115
|
-
background-image: var(--components-avatar-url);
|
|
116
|
-
background-size: cover;
|
|
117
|
-
background-position: center;
|
|
118
|
-
mix-blend-mode: luminosity;
|
|
119
|
-
opacity: 0.3;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.components-avatar.has-status:not(.has-src) > .components-avatar__image {
|
|
124
|
-
color: rgba($white, 0.3);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.components-avatar.has-status.has-avatar-border-color > .components-avatar__image {
|
|
128
|
-
background-color: var(--components-avatar-outline-color);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.components-avatar__status-indicator {
|
|
132
|
-
position: absolute;
|
|
133
|
-
inset: 0;
|
|
134
|
-
display: flex;
|
|
135
|
-
align-items: center;
|
|
136
|
-
justify-content: center;
|
|
137
|
-
z-index: 1;
|
|
138
|
-
color: $white;
|
|
139
|
-
fill: $white;
|
|
140
|
-
|
|
141
|
-
svg {
|
|
142
|
-
width: 75%;
|
|
143
|
-
height: 75%;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
@media (prefers-reduced-motion: reduce) {
|
|
148
|
-
.components-avatar.has-badge,
|
|
149
|
-
.components-avatar__name {
|
|
150
|
-
transition: none;
|
|
151
|
-
}
|
|
152
|
-
}
|
package/src/avatar/types.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import type { IconType } from '../icon';
|
|
2
|
-
|
|
3
|
-
export type AvatarProps = {
|
|
4
|
-
/**
|
|
5
|
-
* URL of the avatar image.
|
|
6
|
-
*
|
|
7
|
-
* When not provided, initials derived from `name` are shown.
|
|
8
|
-
*/
|
|
9
|
-
src?: string;
|
|
10
|
-
/**
|
|
11
|
-
* Name of the user. Used as an accessible label and to generate
|
|
12
|
-
* initials when no image is provided.
|
|
13
|
-
*/
|
|
14
|
-
name?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Visible text shown in the hover badge. When not provided, `name`
|
|
17
|
-
* is used instead. Use this to provide contextual labels like "You"
|
|
18
|
-
* without affecting the accessible name or initials.
|
|
19
|
-
*/
|
|
20
|
-
label?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Whether to show the hover-expand badge that reveals the user's
|
|
23
|
-
* name (or `label`) on hover. Requires `name` to be set.
|
|
24
|
-
*
|
|
25
|
-
* @default false
|
|
26
|
-
*/
|
|
27
|
-
badge?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Size of the avatar.
|
|
30
|
-
*
|
|
31
|
-
* - `'default'`: 32px
|
|
32
|
-
* - `'small'`: 24px
|
|
33
|
-
*
|
|
34
|
-
* @default 'default'
|
|
35
|
-
*/
|
|
36
|
-
size?: 'default' | 'small';
|
|
37
|
-
/**
|
|
38
|
-
* CSS color value for an accent border ring around the avatar.
|
|
39
|
-
*
|
|
40
|
-
* When not provided, no border is rendered and the hover badge
|
|
41
|
-
* and avatar status uses the admin theme color as its background.
|
|
42
|
-
*/
|
|
43
|
-
borderColor?: string;
|
|
44
|
-
/**
|
|
45
|
-
* A status string applied to the avatar. When set, the image is
|
|
46
|
-
* dimmed to indicate a non-default state. A corresponding
|
|
47
|
-
* `is-{status}` class is added for custom styling.
|
|
48
|
-
*/
|
|
49
|
-
status?: string;
|
|
50
|
-
/**
|
|
51
|
-
* An icon or custom component rendered as a centered overlay on the
|
|
52
|
-
* avatar image. Only visible when `status` is set.
|
|
53
|
-
*
|
|
54
|
-
* Accepts any value supported by the `Icon` component: an icon from
|
|
55
|
-
* `@wordpress/icons`, a Dashicon name string, a component, or a
|
|
56
|
-
* JSX element.
|
|
57
|
-
*/
|
|
58
|
-
statusIndicator?: IconType | null;
|
|
59
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import clsx from 'clsx';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { Children } from '@wordpress/element';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Internal dependencies
|
|
13
|
-
*/
|
|
14
|
-
import type { AvatarGroupProps } from './types';
|
|
15
|
-
import type { WordPressComponentProps } from '../context';
|
|
16
|
-
|
|
17
|
-
function AvatarGroup( {
|
|
18
|
-
className,
|
|
19
|
-
max = 3,
|
|
20
|
-
children,
|
|
21
|
-
...props
|
|
22
|
-
}: WordPressComponentProps< AvatarGroupProps, 'div', false > ) {
|
|
23
|
-
const childArray = Children.toArray( children );
|
|
24
|
-
const visible = childArray.slice( 0, max );
|
|
25
|
-
const overflowCount = childArray.length - max;
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<div
|
|
29
|
-
role="group"
|
|
30
|
-
className={ clsx( 'components-avatar-group', className ) }
|
|
31
|
-
{ ...props }
|
|
32
|
-
>
|
|
33
|
-
{ visible }
|
|
34
|
-
{ overflowCount > 0 && (
|
|
35
|
-
<span
|
|
36
|
-
className="components-avatar-group__overflow"
|
|
37
|
-
aria-label={ `${ overflowCount } more` }
|
|
38
|
-
>
|
|
39
|
-
{ `+${ overflowCount }` }
|
|
40
|
-
</span>
|
|
41
|
-
) }
|
|
42
|
-
</div>
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export default AvatarGroup;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
@use "@wordpress/base-styles/colors" as *;
|
|
2
|
-
@use "@wordpress/base-styles/variables" as *;
|
|
3
|
-
|
|
4
|
-
.components-avatar-group {
|
|
5
|
-
display: flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
|
|
8
|
-
// Overlap subsequent avatars.
|
|
9
|
-
> .components-avatar + .components-avatar {
|
|
10
|
-
margin-inline-start: -$grid-unit-10;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// Stack earlier avatars on top of later ones so the overlap
|
|
14
|
-
// is visually correct, and elevate on hover for badge expansion.
|
|
15
|
-
> .components-avatar {
|
|
16
|
-
position: relative;
|
|
17
|
-
|
|
18
|
-
@for $i from 1 through 10 {
|
|
19
|
-
&:nth-child(#{$i}) {
|
|
20
|
-
z-index: #{11 - $i};
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.components-avatar-group__overflow {
|
|
27
|
-
margin-inline-start: $grid-unit-05;
|
|
28
|
-
font-size: $font-size-small;
|
|
29
|
-
line-height: $font-line-height-small;
|
|
30
|
-
color: $gray-900;
|
|
31
|
-
white-space: nowrap;
|
|
32
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type AvatarGroupProps = {
|
|
2
|
-
/**
|
|
3
|
-
* Maximum number of avatars to display before showing an
|
|
4
|
-
* overflow indicator.
|
|
5
|
-
*
|
|
6
|
-
* @default 3
|
|
7
|
-
*/
|
|
8
|
-
max?: number;
|
|
9
|
-
/**
|
|
10
|
-
* Avatar elements to display in the group.
|
|
11
|
-
*/
|
|
12
|
-
children: React.ReactNode;
|
|
13
|
-
};
|