@nypl/design-system-react-components 0.25.1 → 0.25.5
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 +118 -1
- package/README.md +98 -50
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +4 -0
- package/dist/components/Button/Button.d.ts +13 -8
- package/dist/components/Button/ButtonTypes.d.ts +2 -1
- package/dist/components/Card/Card.d.ts +36 -52
- package/dist/components/Card/CardTypes.d.ts +0 -15
- package/dist/components/Checkbox/Checkbox.d.ts +17 -13
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +4 -2
- package/dist/components/ComponentWrapper/ComponentWrapper.d.ts +15 -0
- package/dist/components/DatePicker/DatePicker.d.ts +36 -34
- package/dist/components/Fieldset/Fieldset.d.ts +25 -0
- package/dist/components/Heading/Heading.d.ts +4 -4
- package/dist/components/HelperErrorText/HelperErrorText.d.ts +17 -14
- package/dist/components/HorizontalRule/HorizontalRule.d.ts +10 -9
- package/dist/components/Icons/Icon.d.ts +8 -0
- package/dist/components/Icons/IconSvgs.d.ts +11 -0
- package/dist/components/Icons/IconTypes.d.ts +11 -0
- package/dist/components/Image/Image.d.ts +19 -9
- package/dist/components/Image/ImageTypes.d.ts +20 -0
- package/dist/components/Link/Link.d.ts +4 -0
- package/dist/components/List/List.d.ts +19 -14
- package/dist/components/Notification/Notification.d.ts +37 -16
- package/dist/components/Pagination/Pagination.d.ts +16 -13
- package/dist/components/Pagination/Pagination.stories.d.ts +2 -0
- package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +29 -0
- package/dist/components/ProgressIndicator/ProgressIndicatorTypes.d.ts +8 -0
- package/dist/components/Radio/Radio.d.ts +2 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +4 -2
- package/dist/components/SearchBar/SearchBar.d.ts +3 -3
- package/dist/components/Select/Select.d.ts +2 -0
- package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +18 -14
- package/dist/components/Slider/Slider.d.ts +57 -0
- package/dist/components/StyleGuide/ColorCard.d.ts +12 -0
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/TextInput/TextInput.d.ts +12 -0
- package/dist/components/VideoPlayer/VideoPlayer.d.ts +6 -8
- package/dist/components/VideoPlayer/VideoPlayerTypes.d.ts +2 -2
- package/dist/design-system-react-components.cjs.development.js +6131 -3715
- package/dist/design-system-react-components.cjs.development.js.map +1 -1
- package/dist/design-system-react-components.cjs.production.min.js +1 -1
- package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
- package/dist/design-system-react-components.esm.js +6124 -3699
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/hooks/tests/useCarouselStyles.test.d.ts +1 -0
- package/dist/hooks/useCarouselStyles.d.ts +16 -0
- package/dist/hooks/useNYPLTheme.d.ts +54 -0
- package/dist/hooks/useWindowSize.d.ts +10 -0
- package/dist/index.d.ts +13 -8
- package/dist/resources.scss +180 -170
- package/dist/styles.css +1 -1
- package/dist/theme/components/button.d.ts +22 -8
- package/dist/theme/components/card.d.ts +168 -0
- package/dist/theme/components/checkbox.d.ts +5 -1
- package/dist/theme/components/checkboxGroup.d.ts +12 -0
- package/dist/theme/components/componentWrapper.d.ts +11 -0
- package/dist/theme/components/datePicker.d.ts +16 -0
- package/dist/theme/components/fieldset.d.ts +27 -0
- package/dist/theme/components/global.d.ts +23 -13
- package/dist/theme/components/globalMixins.d.ts +9 -1
- package/dist/theme/components/heading.d.ts +5 -0
- package/dist/theme/components/helperErrorText.d.ts +10 -0
- package/dist/theme/components/hero.d.ts +1 -0
- package/dist/theme/components/horizontalRule.d.ts +14 -0
- package/dist/theme/components/image.d.ts +31 -0
- package/dist/theme/components/label.d.ts +5 -3
- package/dist/theme/components/link.d.ts +4 -0
- package/dist/theme/components/list.d.ts +89 -0
- package/dist/theme/components/notification.d.ts +75 -0
- package/dist/theme/components/pagination.d.ts +19 -0
- package/dist/theme/components/progressIndicator.d.ts +50 -0
- package/dist/theme/components/radioGroup.d.ts +12 -0
- package/dist/theme/components/select.d.ts +11 -2
- package/dist/theme/components/skeletonLoader.d.ts +98 -0
- package/dist/theme/components/slider.d.ts +51 -0
- package/dist/theme/components/tabs.d.ts +54 -3
- package/dist/theme/components/textInput.d.ts +8 -1
- package/dist/theme/components/videoPlayer.d.ts +40 -0
- package/dist/theme/foundations/breakpoints.d.ts +8 -8
- package/dist/theme/foundations/global.d.ts +6 -1
- package/dist/theme/foundations/radii.d.ts +5 -0
- package/dist/theme/foundations/spacing.d.ts +16 -16
- package/package.json +72 -83
- package/src/__tests__/setup.ts +2 -2
- package/src/components/Accordion/Accordion.stories.mdx +39 -44
- package/src/components/Autosuggest/Autosuggest.stories.mdx +3 -3
- package/src/components/Autosuggest/Autosuggest.stories.tsx +2 -1
- package/src/components/Autosuggest/_Autosuggest.scss +5 -5
- package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +14 -10
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +23 -0
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +5 -1
- package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +199 -1
- package/src/components/Button/Button.stories.mdx +15 -10
- package/src/components/Button/Button.test.tsx +21 -7
- package/src/components/Button/Button.tsx +22 -34
- package/src/components/Button/ButtonTypes.tsx +1 -0
- package/src/components/Button/__snapshots__/Button.test.tsx.snap +41 -10
- package/src/components/Card/Card.stories.mdx +296 -259
- package/src/components/Card/Card.test.tsx +156 -84
- package/src/components/Card/Card.tsx +195 -145
- package/src/components/Card/CardTypes.tsx +0 -17
- package/src/components/Card/__snapshots__/Card.test.tsx.snap +410 -0
- package/src/components/CardEdition/CardEdition.stories.tsx +15 -47
- package/src/components/CardEdition/_CardEdition.scss +22 -23
- package/src/components/Chakra/Box.stories.mdx +15 -16
- package/src/components/Chakra/Center.stories.mdx +31 -16
- package/src/components/Chakra/Grid.stories.mdx +28 -15
- package/src/components/Chakra/Stack.stories.mdx +35 -18
- package/src/components/Checkbox/Checkbox.stories.mdx +33 -11
- package/src/components/Checkbox/Checkbox.test.tsx +47 -2
- package/src/components/Checkbox/Checkbox.tsx +39 -33
- package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +90 -2
- package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +82 -2
- package/src/components/CheckboxGroup/CheckboxGroup.test.tsx +29 -2
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +22 -18
- package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +47 -81
- package/src/components/ComponentWrapper/ComponentWrapper.tsx +63 -0
- package/src/components/DatePicker/DatePicker.stories.mdx +163 -62
- package/src/components/DatePicker/DatePicker.test.tsx +264 -64
- package/src/components/DatePicker/DatePicker.tsx +159 -128
- package/src/components/DatePicker/_DatePicker.scss +33 -67
- package/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap +818 -0
- package/src/components/Fieldset/Fieldset.stories.mdx +55 -0
- package/src/components/Fieldset/Fieldset.test.tsx +125 -0
- package/src/components/Fieldset/Fieldset.tsx +52 -0
- package/src/components/Fieldset/__snapshots__/Fieldset.test.tsx.snap +68 -0
- package/src/components/Form/Form.stories.mdx +24 -6
- package/src/components/Form/Form.test.tsx +1 -1
- package/src/components/Form/Form.tsx +1 -0
- package/src/components/Grid/SimpleGrid.stories.mdx +32 -39
- package/src/components/Grid/SimpleGrid.test.tsx +4 -4
- package/src/components/Heading/Heading.stories.mdx +3 -4
- package/src/components/Heading/Heading.tsx +5 -5
- package/src/components/HelperErrorText/HelperErrorText.stories.mdx +124 -0
- package/src/components/HelperErrorText/HelperErrorText.test.tsx +39 -44
- package/src/components/HelperErrorText/HelperErrorText.tsx +37 -39
- package/src/components/HelperErrorText/__snapshots__/HelperErrorText.test.tsx.snap +25 -0
- package/src/components/Hero/Hero.stories.mdx +12 -2
- package/src/components/Hero/Hero.tsx +1 -1
- package/src/components/Hero/HeroTypes.tsx +1 -0
- package/src/components/Hero/__snapshots__/Hero.test.tsx.snap +7 -7
- package/src/components/HorizontalRule/HorizontalRule.stories.mdx +8 -6
- package/src/components/HorizontalRule/HorizontalRule.test.tsx +33 -28
- package/src/components/HorizontalRule/HorizontalRule.tsx +27 -29
- package/src/components/HorizontalRule/__snapshots__/HorizontalRule.test.tsx.snap +27 -9
- package/src/components/Icons/Icon.stories.mdx +12 -4
- package/src/components/Icons/Icon.test.tsx +18 -0
- package/src/components/Icons/Icon.tsx +16 -1
- package/src/components/Icons/IconSvgs.tsx +22 -0
- package/src/components/Icons/IconTypes.tsx +11 -0
- package/src/components/Image/Image.stories.mdx +220 -0
- package/src/components/Image/Image.test.tsx +131 -29
- package/src/components/Image/Image.tsx +84 -56
- package/src/components/Image/ImageTypes.ts +22 -0
- package/src/components/Image/__snapshots__/Image.test.tsx.snap +190 -0
- package/src/components/Input/Input.stories.tsx +23 -67
- package/src/components/Input/Input.test.tsx +4 -4
- package/src/components/Input/_Input.scss +23 -14
- package/src/components/Link/Link.tsx +4 -1
- package/src/components/List/List.stories.mdx +124 -49
- package/src/components/List/List.test.tsx +142 -63
- package/src/components/List/List.tsx +89 -93
- package/src/components/List/__snapshots__/List.test.tsx.snap +109 -0
- package/src/components/Modal/Modal.stories.mdx +3 -3
- package/src/components/Modal/_Modal.scss +2 -2
- package/src/components/Notification/Notification.stories.mdx +109 -112
- package/src/components/Notification/Notification.test.tsx +99 -110
- package/src/components/Notification/Notification.tsx +156 -159
- package/src/components/Notification/__snapshots__/Notification.test.tsx.snap +159 -8
- package/src/components/Pagination/Pagination.stories.mdx +26 -27
- package/src/components/Pagination/Pagination.stories.tsx +11 -16
- package/src/components/Pagination/Pagination.test.tsx +276 -146
- package/src/components/Pagination/Pagination.tsx +174 -154
- package/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap +285 -0
- package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +292 -0
- package/src/components/ProgressIndicator/ProgressIndicator.test.tsx +225 -0
- package/src/components/ProgressIndicator/ProgressIndicator.tsx +126 -0
- package/src/components/ProgressIndicator/ProgressIndicatorTypes.ts +8 -0
- package/src/components/ProgressIndicator/__snapshots__/ProgressIndicator.test.tsx.snap +357 -0
- package/src/components/Radio/Radio.test.tsx +20 -4
- package/src/components/Radio/Radio.tsx +6 -3
- package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +3 -0
- package/src/components/RadioGroup/RadioGroup.stories.mdx +3 -4
- package/src/components/RadioGroup/RadioGroup.test.tsx +24 -1
- package/src/components/RadioGroup/RadioGroup.tsx +19 -19
- package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +42 -72
- package/src/components/SearchBar/SearchBar.Test.tsx +20 -1
- package/src/components/SearchBar/SearchBar.stories.mdx +113 -8
- package/src/components/SearchBar/SearchBar.tsx +20 -10
- package/src/components/Select/Select.test.tsx +12 -0
- package/src/components/Select/Select.tsx +5 -2
- package/src/components/Select/SelectTypes.tsx +1 -0
- package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +28 -59
- package/src/components/SkeletonLoader/SkeletonLoader.test.tsx +97 -177
- package/src/components/SkeletonLoader/SkeletonLoader.tsx +74 -71
- package/src/components/SkeletonLoader/__snapshots__/SkeletonLoader.test.tsx.snap +739 -0
- package/src/components/Slider/Slider.stories.mdx +529 -0
- package/src/components/Slider/Slider.test.tsx +653 -0
- package/src/components/Slider/Slider.tsx +303 -0
- package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +1946 -0
- package/src/components/StyleGuide/Bidirectionality.stories.mdx +1 -1
- package/src/components/StyleGuide/Breakpoints.stories.mdx +34 -10
- package/src/components/StyleGuide/Buttons.stories.mdx +89 -73
- package/src/components/StyleGuide/ColorCard.tsx +46 -0
- package/src/components/StyleGuide/Colors.stories.mdx +171 -311
- package/src/components/StyleGuide/DesignTokens.stories.mdx +170 -0
- package/src/components/StyleGuide/Forms.stories.mdx +9 -7
- package/src/components/StyleGuide/Iconography.stories.mdx +85 -91
- package/src/components/StyleGuide/Spacing.stories.mdx +31 -23
- package/src/components/StyleGuide/Typography.stories.mdx +202 -189
- package/src/components/StyleGuide/UIDocCard.tsx +1 -1
- package/src/components/Tabs/Tabs.stories.mdx +73 -11
- package/src/components/Tabs/Tabs.tsx +87 -64
- package/src/components/Template/Template.stories.mdx +25 -27
- package/src/components/TextInput/TextInput.stories.mdx +1 -1
- package/src/components/TextInput/TextInput.test.tsx +22 -2
- package/src/components/TextInput/TextInput.tsx +28 -8
- package/src/components/TextInput/TextInputTypes.tsx +2 -0
- package/src/components/VideoPlayer/VideoPlayer.stories.mdx +17 -4
- package/src/components/VideoPlayer/VideoPlayer.test.tsx +54 -53
- package/src/components/VideoPlayer/VideoPlayer.tsx +50 -51
- package/src/components/VideoPlayer/VideoPlayerTypes.tsx +2 -2
- package/src/components/VideoPlayer/__snapshots__/VideoPlayer.test.tsx.snap +91 -0
- package/src/docs/Chakra.stories.mdx +244 -63
- package/src/docs/Intro.stories.mdx +5 -2
- package/src/hooks/tests/useCarouselStyles.test.ts +140 -0
- package/src/hooks/tests/useNYPLTheme.test.tsx +36 -0
- package/src/hooks/useCarouselStyles.ts +34 -0
- package/src/hooks/useNYPLTheme.ts +67 -0
- package/src/hooks/useWindowSize.ts +40 -0
- package/src/index.ts +22 -19
- package/src/resources.scss +5 -5
- package/src/styles/base/{_02-breakpoints.scss → _01-breakpoints.scss} +9 -10
- package/src/styles/base/{_03-mixins.scss → _02-mixins.scss} +16 -5
- package/src/styles/base/{_04-base.scss → _03-base.scss} +7 -2
- package/src/styles/base/{_05-focus.scss → _04-focus.scss} +0 -15
- package/src/styles/base/_place-holder.scss +14 -3
- package/src/styles/{03-space → space}/_space-inline.scss +14 -14
- package/src/styles/{03-space → space}/_space-inset.scss +10 -10
- package/src/styles/space/_space-stack.scss +116 -0
- package/src/styles.scss +13 -60
- package/src/theme/components/button.ts +21 -15
- package/src/theme/components/card.ts +174 -0
- package/src/theme/components/checkbox.ts +8 -3
- package/src/theme/components/checkboxGroup.ts +8 -0
- package/src/theme/components/componentWrapper.ts +10 -0
- package/src/theme/components/datePicker.ts +17 -0
- package/src/theme/components/fieldset.ts +18 -0
- package/src/theme/components/global.ts +26 -15
- package/src/theme/components/globalMixins.ts +9 -1
- package/src/theme/components/heading.ts +10 -5
- package/src/theme/components/helperErrorText.ts +9 -0
- package/src/theme/components/hero.ts +4 -3
- package/src/theme/components/horizontalRule.ts +13 -0
- package/src/theme/components/icon.ts +9 -9
- package/src/theme/components/image.ts +116 -0
- package/src/theme/components/label.ts +3 -10
- package/src/theme/components/link.ts +5 -1
- package/src/theme/components/list.ts +73 -0
- package/src/theme/components/notification.ts +93 -0
- package/src/theme/components/pagination.ts +20 -0
- package/src/theme/components/progressIndicator.ts +62 -0
- package/src/theme/components/radio.ts +2 -2
- package/src/theme/components/radioGroup.ts +8 -0
- package/src/theme/components/select.ts +6 -3
- package/src/theme/components/skeletonLoader.ts +107 -0
- package/src/theme/components/slider.ts +79 -0
- package/src/theme/components/statusBadge.ts +1 -2
- package/src/theme/components/tabs.ts +49 -19
- package/src/theme/components/template.ts +8 -8
- package/src/theme/components/textInput.ts +5 -4
- package/src/theme/components/videoPlayer.ts +49 -0
- package/src/theme/foundations/breakpoints.ts +8 -8
- package/src/theme/foundations/global.ts +6 -1
- package/src/theme/foundations/radii.ts +6 -0
- package/src/theme/foundations/spacing.ts +24 -24
- package/src/theme/index.ts +41 -10
- package/src/utils/componentCategories.ts +4 -3
- package/dist/components/HelperErrorText/HelperErrorText.stories.d.ts +0 -16
- package/dist/components/Image/Image.stories.d.ts +0 -18
- package/dist/components/List/List.stories.d.ts +0 -7
- package/dist/theme/components/customCheckboxGroup.d.ts +0 -18
- package/dist/theme/components/customRadioGroup.d.ts +0 -18
- package/src/components/Button/_Button.scss +0 -32
- package/src/components/Card/_Card.scss +0 -308
- package/src/components/HelperErrorText/HelperErrorText.stories.tsx +0 -48
- package/src/components/HelperErrorText/_HelperErrorText.scss +0 -9
- package/src/components/HorizontalRule/_HorizontalRule.scss +0 -15
- package/src/components/Image/Image.stories.tsx +0 -54
- package/src/components/Image/_Image.scss +0 -38
- package/src/components/List/List.stories.tsx +0 -139
- package/src/components/List/_List.scss +0 -76
- package/src/components/Notification/_Notification.scss +0 -110
- package/src/components/Pagination/_Pagination.scss +0 -40
- package/src/components/SkeletonLoader/_SkeletonLoader.scss +0 -142
- package/src/components/VideoPlayer/_VideoPlayer.scss +0 -38
- package/src/styles/01-colors/_colors-brand.scss +0 -62
- package/src/styles/01-colors/_colors-utility.scss +0 -67
- package/src/styles/02-typography/_type-scale.css +0 -11
- package/src/styles/02-typography/_type-weight.css +0 -7
- package/src/styles/02-typography/_typefaces.css +0 -4
- package/src/styles/03-space/_space-stack.scss +0 -116
- package/src/styles/03-space/_space.css +0 -30
- package/src/styles/base/_card-grid.scss +0 -78
- package/src/styles/base/_typography.scss +0 -11
- package/src/theme/components/customCheckboxGroup.ts +0 -12
- package/src/theme/components/customRadioGroup.ts +0 -12
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom hook that controls the sliding function for the carousel wrapper.
|
|
3
|
+
* This returns functions to use for the "previous" and "next" buttons as well
|
|
4
|
+
* as a CSS style object that should be use to transition between slides.
|
|
5
|
+
* Inspired by: https://codesandbox.io/s/fxjeo
|
|
6
|
+
*/
|
|
7
|
+
declare const useCarouselStyles: (slidesCount?: number, slideWidth?: number) => {
|
|
8
|
+
prevSlide: () => void;
|
|
9
|
+
nextSlide: () => void;
|
|
10
|
+
carouselStyle: {
|
|
11
|
+
transition: string;
|
|
12
|
+
marginLeft: string;
|
|
13
|
+
};
|
|
14
|
+
goToStart: () => void;
|
|
15
|
+
};
|
|
16
|
+
export default useCarouselStyles;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A custom hook that returns the Chakra-based NYPL theme object. This must be
|
|
3
|
+
* used inside a component that is wrapped in the `DSProvider` component, so
|
|
4
|
+
* that the theme object can be available to use.
|
|
5
|
+
*/
|
|
6
|
+
declare function useNYPLTheme(): {
|
|
7
|
+
breakpoints?: undefined;
|
|
8
|
+
colors?: undefined;
|
|
9
|
+
fontSizes?: undefined;
|
|
10
|
+
fontWeights?: undefined;
|
|
11
|
+
fonts?: undefined;
|
|
12
|
+
radii?: undefined;
|
|
13
|
+
space?: undefined;
|
|
14
|
+
} | {
|
|
15
|
+
breakpoints: any;
|
|
16
|
+
colors: {
|
|
17
|
+
brand: any;
|
|
18
|
+
section: any;
|
|
19
|
+
transparent: any;
|
|
20
|
+
ui: any;
|
|
21
|
+
};
|
|
22
|
+
fontSizes: {
|
|
23
|
+
"-3": any;
|
|
24
|
+
"-2": any;
|
|
25
|
+
"-1": any;
|
|
26
|
+
0: any;
|
|
27
|
+
1: any;
|
|
28
|
+
2: any;
|
|
29
|
+
3: any;
|
|
30
|
+
4: any;
|
|
31
|
+
};
|
|
32
|
+
fontWeights: {
|
|
33
|
+
light: any;
|
|
34
|
+
regular: any;
|
|
35
|
+
medium: any;
|
|
36
|
+
bold: any;
|
|
37
|
+
};
|
|
38
|
+
fonts: {
|
|
39
|
+
body: any;
|
|
40
|
+
heading: any;
|
|
41
|
+
};
|
|
42
|
+
radii: any;
|
|
43
|
+
space: {
|
|
44
|
+
xxs: any;
|
|
45
|
+
xs: any;
|
|
46
|
+
s: any;
|
|
47
|
+
m: any;
|
|
48
|
+
l: any;
|
|
49
|
+
xl: any;
|
|
50
|
+
xxl: any;
|
|
51
|
+
xxxl: any;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export default useNYPLTheme;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface WindowSize {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* React hook used to get the window size on device resizing.
|
|
7
|
+
* Based on https://usehooks-typescript.com/react-hook/use-window-size
|
|
8
|
+
*/
|
|
9
|
+
declare function useWindowSize(): WindowSize;
|
|
10
|
+
export default useWindowSize;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import "./styles.scss";
|
|
2
|
-
export { Box, Center, Circle, Grid, GridItem, Square, Stack,
|
|
2
|
+
export { Box, ButtonGroup, Center, Circle, Grid, GridItem, HStack, Square, Stack, VStack, } from "@chakra-ui/react";
|
|
3
3
|
export { default as Accordion } from "./components/Accordion/Accordion";
|
|
4
4
|
export { default as Breadcrumbs } from "./components/Breadcrumbs/Breadcrumbs";
|
|
5
|
-
export {
|
|
5
|
+
export { ColorVariants } from "./components/Breadcrumbs/BreadcrumbsTypes";
|
|
6
|
+
export { default as Button } from "./components/Button/Button";
|
|
6
7
|
export { ButtonTypes } from "./components/Button/ButtonTypes";
|
|
7
8
|
export { default as Card, CardActions, CardContent, CardHeading, } from "./components/Card/Card";
|
|
8
|
-
export {
|
|
9
|
+
export { CardLayouts } from "./components/Card/CardTypes";
|
|
9
10
|
export { default as CardEdition } from "./components/CardEdition/CardEdition";
|
|
10
11
|
export { default as Checkbox } from "./components/Checkbox/Checkbox";
|
|
11
12
|
export { default as CheckboxGroup } from "./components/CheckboxGroup/CheckboxGroup";
|
|
12
13
|
export { CheckboxGroupLayoutTypes } from "./components/CheckboxGroup/CheckboxGroupLayoutTypes";
|
|
13
14
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
14
15
|
export { DatePickerTypes } from "./components/DatePicker/DatePickerTypes";
|
|
16
|
+
export { default as DSProvider } from "./theme/provider";
|
|
17
|
+
export { default as Fieldset } from "./components/Fieldset/Fieldset";
|
|
15
18
|
export { default as Form, FormField, FormRow } from "./components/Form/Form";
|
|
16
19
|
export { FormSpacing } from "./components/Form/FormTypes";
|
|
17
20
|
export { GridGaps } from "./components/Grid/GridTypes";
|
|
@@ -22,8 +25,9 @@ export { default as Hero } from "./components/Hero/Hero";
|
|
|
22
25
|
export { HeroTypes } from "./components/Hero/HeroTypes";
|
|
23
26
|
export { default as HorizontalRule } from "./components/HorizontalRule/HorizontalRule";
|
|
24
27
|
export { default as Icon } from "./components/Icons/Icon";
|
|
25
|
-
export {
|
|
28
|
+
export { IconAlign, IconColors, IconNames, IconRotationTypes, IconSizes, IconTypes, LogoNames, } from "./components/Icons/IconTypes";
|
|
26
29
|
export { default as Image } from "./components/Image/Image";
|
|
30
|
+
export { ImageRatios, ImageSizes, ImageTypes, } from "./components/Image/ImageTypes";
|
|
27
31
|
export { default as Input } from "./components/Input/Input";
|
|
28
32
|
export { InputTypes } from "./components/Input/InputTypes";
|
|
29
33
|
export { default as Label } from "./components/Label/Label";
|
|
@@ -32,24 +36,25 @@ export { LinkTypes } from "./components/Link/LinkTypes";
|
|
|
32
36
|
export { default as List } from "./components/List/List";
|
|
33
37
|
export { ListTypes } from "./components/List/ListTypes";
|
|
34
38
|
export { default as Modal } from "./components/Modal/Modal";
|
|
35
|
-
export { default as Notification
|
|
39
|
+
export { default as Notification } from "./components/Notification/Notification";
|
|
36
40
|
export { NotificationTypes } from "./components/Notification/NotificationTypes";
|
|
37
41
|
export { default as Pagination } from "./components/Pagination/Pagination";
|
|
38
42
|
export { default as Radio } from "./components/Radio/Radio";
|
|
39
43
|
export { default as RadioGroup } from "./components/RadioGroup/RadioGroup";
|
|
40
44
|
export { RadioGroupLayoutTypes } from "./components/RadioGroup/RadioGroupLayoutTypes";
|
|
41
45
|
export { default as SearchBar } from "./components/SearchBar/SearchBar";
|
|
46
|
+
export { default as Select } from "./components/Select/Select";
|
|
42
47
|
export { default as SimpleGrid } from "./components/Grid/SimpleGrid";
|
|
43
48
|
export { default as SkeletonLoader } from "./components/SkeletonLoader/SkeletonLoader";
|
|
44
49
|
export { SkeletonLoaderImageRatios, SkeletonLoaderLayouts, } from "./components/SkeletonLoader/SkeletonLoaderTypes";
|
|
45
|
-
export { default as Select } from "./components/Select/Select";
|
|
46
50
|
export { default as StatusBadge } from "./components/StatusBadge/StatusBadge";
|
|
51
|
+
export { StatusBadgeTypes } from "./components/StatusBadge/StatusBadgeTypes";
|
|
47
52
|
export { Tabs, TabList, Tab, TabPanels, TabPanel, } from "./components/Tabs/Tabs";
|
|
53
|
+
export { TemplateAppContainer, Template, TemplateHeader, TemplateBreakout, TemplateContent, TemplateContentTop, TemplateContentPrimary, TemplateContentSidebar, TemplateFooter, } from "./components/Template/Template";
|
|
48
54
|
export { default as Text } from "./components/Text/Text";
|
|
49
55
|
export { TextDisplaySizes } from "./components/Text/TextTypes";
|
|
50
|
-
export { TemplateAppContainer, Template, TemplateHeader, TemplateBreakout, TemplateContent, TemplateContentTop, TemplateContentPrimary, TemplateContentSidebar, TemplateFooter, } from "./components/Template/Template";
|
|
51
56
|
export { default as TextInput, TextInputRefType, } from "./components/TextInput/TextInput";
|
|
52
57
|
export { TextInputTypes } from "./components/TextInput/TextInputTypes";
|
|
58
|
+
export { default as useNYPLTheme } from "./hooks/useNYPLTheme";
|
|
53
59
|
export { default as VideoPlayer } from "./components/VideoPlayer/VideoPlayer";
|
|
54
60
|
export { VideoPlayerAspectRatios, VideoPlayerTypes, } from "./components/VideoPlayer/VideoPlayerTypes";
|
|
55
|
-
export { default as DSProvider } from "./theme/provider";
|
package/dist/resources.scss
CHANGED
|
@@ -1,12 +1,144 @@
|
|
|
1
1
|
// Resources to export as sass mixins
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
* Breakpoint Configuration
|
|
4
|
+
* @see https://github.com/Team-Sass/breakpoint/wiki
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// Global Breakpoints
|
|
8
|
+
|
|
9
|
+
// Avoid using in favor of atomic, content-specific, breakpoints.
|
|
10
|
+
// These should be used for generic code, like layouts and typography, only.
|
|
11
|
+
// The CSS variables and the Sass variables below need to stay in sync.
|
|
12
|
+
// Sass' breakpoint() mixin doesn't work without Sass variables.
|
|
13
|
+
// CSS variables expose the breakpoint variables to consumers.
|
|
14
|
+
:root {
|
|
15
|
+
--nypl-breakpoint-small: 320px;
|
|
16
|
+
--nypl-breakpoint-medium: 600px;
|
|
17
|
+
--nypl-breakpoint-large: 960px;
|
|
18
|
+
--nypl-breakpoint-xl: 1280px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
$nypl-breakpoint-small: 320px;
|
|
22
|
+
$nypl-breakpoint-medium: 600px;
|
|
23
|
+
$nypl-breakpoint-large: 960px;
|
|
24
|
+
$nypl-breakpoint-xl: 1280px;
|
|
25
|
+
// The max-width breakpoint is used when the design should be applied at
|
|
26
|
+
// whatever the largest breakpoint is regardless of actual pixel value,
|
|
27
|
+
// e.g. removing outer margin on body wrapper.
|
|
28
|
+
$nypl-max-width: $nypl-breakpoint-xl;
|
|
29
|
+
|
|
30
|
+
/////////////////////
|
|
31
|
+
// General Mixins (put specific ones in component files where applicable)
|
|
32
|
+
|
|
33
|
+
/// Mixin - Clearfix.
|
|
34
|
+
/// Adds clearfix based on http://bourbon.io/docs/#clearfix
|
|
35
|
+
/// use example = @include clearfix
|
|
36
|
+
|
|
37
|
+
@mixin clearfix {
|
|
38
|
+
&::after {
|
|
39
|
+
clear: both;
|
|
40
|
+
content: "";
|
|
41
|
+
display: table;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@mixin list-reset {
|
|
46
|
+
list-style: none;
|
|
47
|
+
margin: 0;
|
|
48
|
+
padding: 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@mixin fieldset-reset {
|
|
52
|
+
border: none;
|
|
53
|
+
margin: 0;
|
|
54
|
+
padding: 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/// Mixin - Wrapper
|
|
58
|
+
/// Outer container mixin for large screens
|
|
59
|
+
@mixin wrapper(
|
|
60
|
+
$container-max-width: $max-width,
|
|
61
|
+
$outer-container-break: $nypl-breakpoint-small,
|
|
62
|
+
$v-margin: 0,
|
|
63
|
+
$v-padding: 0,
|
|
64
|
+
$h-padding: var(--nypl-space-s)
|
|
65
|
+
) {
|
|
66
|
+
margin: #{$v-margin} auto;
|
|
67
|
+
max-width: #{$container-max-width};
|
|
68
|
+
padding: #{$v-padding} #{$h-padding};
|
|
69
|
+
width: 100%;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.container {
|
|
73
|
+
padding: var(--nypl-space-s);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/// Use the breakout mixin for elements that should be edge-to-edge
|
|
77
|
+
/// Even when a parent container uses the wrapper mixin
|
|
78
|
+
@mixin breakout($v-padding: var(--nypl-space-s)) {
|
|
79
|
+
margin-left: calc(-50vw + 50%);
|
|
80
|
+
margin-right: calc(-50vw + 50%);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Use the screenreader-only mixin for elements that you want to be visually hidden, but still want screenreaders to read out
|
|
84
|
+
@mixin screenreader-only() {
|
|
85
|
+
clip: rect(1px, 1px, 1px, 1px);
|
|
86
|
+
height: 1px;
|
|
87
|
+
overflow: hidden;
|
|
88
|
+
position: absolute !important;
|
|
89
|
+
width: 1px;
|
|
90
|
+
word-wrap: normal;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Focus state mixin
|
|
94
|
+
@mixin focus-outline($darkBackground: false) {
|
|
95
|
+
outline: 2px solid var(--nypl-colors-ui-focus);
|
|
96
|
+
outline-offset: 2px;
|
|
97
|
+
z-index: 9999;
|
|
98
|
+
|
|
99
|
+
@if $darkBackground {
|
|
100
|
+
outline-color: var(--nypl-colors-ui-white);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
//Convert pixel values to rem
|
|
105
|
+
@function to-rem($size) {
|
|
106
|
+
@return $size / 16px * 1rem;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
//Process a color variable so that it can be used in a data URI/URL
|
|
110
|
+
@function url-friendly-colour($colour) {
|
|
111
|
+
@return "%23" + str-slice("#{$colour}", 2, -1);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@mixin placeholder {
|
|
115
|
+
&::-webkit-input-placeholder {
|
|
116
|
+
@content;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&::-moz-placeholder {
|
|
120
|
+
@content;
|
|
121
|
+
|
|
122
|
+
opacity: 1;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&:-moz-placeholder {
|
|
126
|
+
@content;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&:-ms-input-placeholder {
|
|
130
|
+
@content;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* --nypl-space-xxs: --nypl-space-s / 4 // 4px or 0.25rem
|
|
136
|
+
* --nypl-space-xs: --nypl-space-s / 2 // 8px or 0.5rem
|
|
137
|
+
* --nypl-space-s: --nypl-space-s * 1; // 16px or 1rem
|
|
138
|
+
* --nypl-space-m: --nypl-space * 1.5; // 24px or 1.5rem
|
|
139
|
+
* --nypl-space-l: --nypl-space * 2; // 32px or 2rem
|
|
140
|
+
* --nypl-space-xl: --nypl-space * 3; // 48px or 3rem
|
|
141
|
+
* --nypl-space-xxl: --nypl-space * 4; // 64px or 4rem
|
|
10
142
|
*/
|
|
11
143
|
|
|
12
144
|
@mixin space-inline-none {
|
|
@@ -14,31 +146,31 @@
|
|
|
14
146
|
}
|
|
15
147
|
|
|
16
148
|
@mixin space-inline-xxs {
|
|
17
|
-
margin-right: var(--space-xxs);
|
|
149
|
+
margin-right: var(--nypl-space-xxs);
|
|
18
150
|
}
|
|
19
151
|
|
|
20
152
|
@mixin space-inline-xs {
|
|
21
|
-
margin-right: var(--space-xs);
|
|
153
|
+
margin-right: var(--nypl-space-xs);
|
|
22
154
|
}
|
|
23
155
|
|
|
24
156
|
@mixin space-inline-s {
|
|
25
|
-
margin-right: var(--space-s);
|
|
157
|
+
margin-right: var(--nypl-space-s);
|
|
26
158
|
}
|
|
27
159
|
|
|
28
160
|
@mixin space-inline-m {
|
|
29
|
-
margin-right: var(--space-m);
|
|
161
|
+
margin-right: var(--nypl-space-m);
|
|
30
162
|
}
|
|
31
163
|
|
|
32
164
|
@mixin space-inline-l {
|
|
33
|
-
margin-right: var(--space-l);
|
|
165
|
+
margin-right: var(--nypl-space-l);
|
|
34
166
|
}
|
|
35
167
|
|
|
36
168
|
@mixin space-inline-xl {
|
|
37
|
-
margin-right: var(--space-xl);
|
|
169
|
+
margin-right: var(--nypl-space-xl);
|
|
38
170
|
}
|
|
39
171
|
|
|
40
172
|
@mixin space-inline-xxl {
|
|
41
|
-
margin-right: var(--space-xxl);
|
|
173
|
+
margin-right: var(--nypl-space-xxl);
|
|
42
174
|
}
|
|
43
175
|
|
|
44
176
|
@mixin get-space-inline($id) {
|
|
@@ -80,11 +212,11 @@
|
|
|
80
212
|
}
|
|
81
213
|
|
|
82
214
|
/**
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
215
|
+
* --nypl-space-xs: --nypl-space-s / 2 // 8px or 0.5rem
|
|
216
|
+
* --nypl-space-s: --nypl-space-s * 1; // 16px or 1rem
|
|
217
|
+
* --nypl-space-m: --nypl-space * 1.5; // 24px or 1.5rem
|
|
218
|
+
* --nypl-space-l: --nypl-space * 2; // 32px or 2rem
|
|
219
|
+
* --nypl-space-xl: --nypl-space * 3; // 48px or 3rem
|
|
88
220
|
*/
|
|
89
221
|
|
|
90
222
|
@mixin space-inset-none {
|
|
@@ -92,23 +224,23 @@
|
|
|
92
224
|
}
|
|
93
225
|
|
|
94
226
|
@mixin space-inset-xs {
|
|
95
|
-
padding: var(--space-xs);
|
|
227
|
+
padding: var(--nypl-space-xs);
|
|
96
228
|
}
|
|
97
229
|
|
|
98
230
|
@mixin space-inset-s {
|
|
99
|
-
padding: var(--space-s);
|
|
231
|
+
padding: var(--nypl-space-s);
|
|
100
232
|
}
|
|
101
233
|
|
|
102
234
|
@mixin space-inset-m {
|
|
103
|
-
padding: var(--space-m);
|
|
235
|
+
padding: var(--nypl-space-m);
|
|
104
236
|
}
|
|
105
237
|
|
|
106
238
|
@mixin space-inset-l {
|
|
107
|
-
padding: var(--space-l);
|
|
239
|
+
padding: var(--nypl-space-l);
|
|
108
240
|
}
|
|
109
241
|
|
|
110
242
|
@mixin space-inset-xl {
|
|
111
|
-
padding: var(--space-xl);
|
|
243
|
+
padding: var(--nypl-space-xl);
|
|
112
244
|
}
|
|
113
245
|
|
|
114
246
|
@mixin get-space-inset($id) {
|
|
@@ -138,14 +270,14 @@
|
|
|
138
270
|
}
|
|
139
271
|
|
|
140
272
|
/**
|
|
141
|
-
* --space-xxs:
|
|
142
|
-
* --space-xs:
|
|
143
|
-
* --space-s:
|
|
144
|
-
* --space-m:
|
|
145
|
-
* --space-l:
|
|
146
|
-
* --space-xl:
|
|
147
|
-
* --space-xxl:
|
|
148
|
-
* --space-xxxl: -
|
|
273
|
+
* --nypl-space-xxs: --nypl-space-s / 4 // 4px or 0.25rem
|
|
274
|
+
* --nypl-space-xs: --nypl-space-s / 2 // 8px or 0.5rem
|
|
275
|
+
* --nypl-space-s: --nypl-space-s * 1; // 16px or 1rem
|
|
276
|
+
* --nypl-space-m: --nypl-space-s * 1.5; // 24px or 1.5rem
|
|
277
|
+
* --nypl-space-l: --nypl-space-s * 2; // 32px or 2rem
|
|
278
|
+
* --nypl-space-xl: --nypl-space-s * 3; // 48px or 3rem
|
|
279
|
+
* --nypl-space-xxl: --nypl-space-s * 4; // 64px or 4rem
|
|
280
|
+
* --nypl-space-xxxl: --nypl-space-s * 6; // 96px or 6rem
|
|
149
281
|
*/
|
|
150
282
|
|
|
151
283
|
@mixin space-stack-none {
|
|
@@ -153,65 +285,65 @@
|
|
|
153
285
|
}
|
|
154
286
|
|
|
155
287
|
@mixin space-stack-xxs {
|
|
156
|
-
margin-bottom: var(--space-xxs);
|
|
288
|
+
margin-bottom: var(--nypl-space-xxs);
|
|
157
289
|
}
|
|
158
290
|
|
|
159
291
|
@mixin space-stack-xs {
|
|
160
|
-
margin-bottom: var(--space-xs);
|
|
292
|
+
margin-bottom: var(--nypl-space-xs);
|
|
161
293
|
}
|
|
162
294
|
|
|
163
295
|
@mixin space-stack-s {
|
|
164
|
-
margin-bottom: var(--space-s);
|
|
296
|
+
margin-bottom: var(--nypl-space-s);
|
|
165
297
|
}
|
|
166
298
|
|
|
167
299
|
@mixin space-stack-m {
|
|
168
|
-
margin-bottom: var(--space-m);
|
|
300
|
+
margin-bottom: var(--nypl-space-m);
|
|
169
301
|
}
|
|
170
302
|
|
|
171
303
|
@mixin space-stack-l {
|
|
172
|
-
margin-bottom: var(--space-l);
|
|
304
|
+
margin-bottom: var(--nypl-space-l);
|
|
173
305
|
}
|
|
174
306
|
|
|
175
307
|
@mixin space-stack-xl {
|
|
176
|
-
margin-bottom: var(--space-xl);
|
|
308
|
+
margin-bottom: var(--nypl-space-xl);
|
|
177
309
|
}
|
|
178
310
|
|
|
179
311
|
@mixin space-stack-xxl {
|
|
180
|
-
margin-bottom: var(--space-xxl);
|
|
312
|
+
margin-bottom: var(--nypl-space-xxl);
|
|
181
313
|
}
|
|
182
314
|
|
|
183
315
|
@mixin space-stack-xxxl {
|
|
184
|
-
margin-bottom: var(--space-xxxl);
|
|
316
|
+
margin-bottom: var(--nypl-space-xxxl);
|
|
185
317
|
}
|
|
186
318
|
|
|
187
319
|
@mixin space-stack-page {
|
|
188
320
|
@include space-stack-l;
|
|
189
321
|
|
|
190
|
-
@include breakpoint($breakpoint-large) {
|
|
322
|
+
@include breakpoint($nypl-breakpoint-large) {
|
|
191
323
|
@include space-stack-xl;
|
|
192
324
|
}
|
|
193
325
|
|
|
194
326
|
&--full {
|
|
195
327
|
@include space-stack-xxl;
|
|
196
328
|
|
|
197
|
-
@include breakpoint($breakpoint-large) {
|
|
329
|
+
@include breakpoint($nypl-breakpoint-large) {
|
|
198
330
|
@include space-stack-xxxl;
|
|
199
331
|
}
|
|
200
332
|
}
|
|
201
333
|
}
|
|
202
334
|
|
|
203
335
|
@mixin remove-stack-page {
|
|
204
|
-
margin-top: calc(-1 *
|
|
336
|
+
margin-top: calc(-1 * 32px);
|
|
205
337
|
|
|
206
|
-
@include breakpoint($breakpoint-large) {
|
|
207
|
-
margin-top: calc(-1 *
|
|
338
|
+
@include breakpoint($nypl-breakpoint-large) {
|
|
339
|
+
margin-top: calc(-1 * 48px);
|
|
208
340
|
}
|
|
209
341
|
|
|
210
342
|
&--full {
|
|
211
|
-
margin-top: calc(-1 *
|
|
343
|
+
margin-top: calc(-1 * 64px);
|
|
212
344
|
|
|
213
|
-
@include breakpoint($breakpoint-large) {
|
|
214
|
-
margin-top: calc(-1 *
|
|
345
|
+
@include breakpoint($nypl-breakpoint-large) {
|
|
346
|
+
margin-top: calc(-1 * 96px);
|
|
215
347
|
}
|
|
216
348
|
}
|
|
217
349
|
}
|
|
@@ -254,125 +386,3 @@
|
|
|
254
386
|
}
|
|
255
387
|
}
|
|
256
388
|
|
|
257
|
-
/**
|
|
258
|
-
* Breakpoint Configuration
|
|
259
|
-
* @see https://github.com/Team-Sass/breakpoint/wiki
|
|
260
|
-
*
|
|
261
|
-
*/
|
|
262
|
-
|
|
263
|
-
// Global Breakpoints
|
|
264
|
-
|
|
265
|
-
// Avoid using in favor of atomic, content-specific, breakpoints.
|
|
266
|
-
// These should be used for generic code, like layouts and typography, only.
|
|
267
|
-
// The CSS variables and the Sass variables below need to stay in sync.
|
|
268
|
-
// Sass' breakpoint() mixin doesn't work without Sass variables.
|
|
269
|
-
// CSS variables expose the breakpoint variables to consumers.
|
|
270
|
-
:root {
|
|
271
|
-
--breakpoint-small: 320px;
|
|
272
|
-
--breakpoint-medium: 600px;
|
|
273
|
-
--breakpoint-large: 960px;
|
|
274
|
-
--breakpoint-xl: 1280px;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
$breakpoint-small: 320px;
|
|
278
|
-
$breakpoint-medium: 600px;
|
|
279
|
-
$breakpoint-large: 960px;
|
|
280
|
-
$breakpoint-xl: 1280px;
|
|
281
|
-
// The max-width breakpoint is used when the design should be applied at
|
|
282
|
-
// whatever the largest breakpoint is regardless of actual pixel value,
|
|
283
|
-
// e.g. removing outer margin on body wrapper.
|
|
284
|
-
$max-width: $breakpoint-xl;
|
|
285
|
-
|
|
286
|
-
/////////////////////
|
|
287
|
-
// General Mixins (put specific ones in component files where applicable)
|
|
288
|
-
|
|
289
|
-
/// Mixin - Clearfix.
|
|
290
|
-
/// Adds clearfix based on http://bourbon.io/docs/#clearfix
|
|
291
|
-
/// use example = @include clearfix
|
|
292
|
-
|
|
293
|
-
@mixin clearfix {
|
|
294
|
-
&::after {
|
|
295
|
-
clear: both;
|
|
296
|
-
content: "";
|
|
297
|
-
display: table;
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
@mixin list-reset {
|
|
302
|
-
list-style: none;
|
|
303
|
-
margin: 0;
|
|
304
|
-
padding: 0;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
@mixin fieldset-reset {
|
|
308
|
-
border: none;
|
|
309
|
-
margin: 0;
|
|
310
|
-
padding: 0;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
/// Mixin - Wrapper
|
|
314
|
-
/// Outer container mixin for large screens
|
|
315
|
-
@mixin wrapper(
|
|
316
|
-
$container-max-width: $max-width,
|
|
317
|
-
$outer-container-break: $breakpoint-small,
|
|
318
|
-
$v-margin: 0,
|
|
319
|
-
$v-padding: 0,
|
|
320
|
-
$h-padding: var(--space)
|
|
321
|
-
) {
|
|
322
|
-
margin: #{$v-margin} auto;
|
|
323
|
-
max-width: #{$container-max-width};
|
|
324
|
-
padding: #{$v-padding} #{$h-padding};
|
|
325
|
-
width: 100%;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
.container {
|
|
329
|
-
@include space-inset-s;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
/// Use the breakout mixin for elements that should be edge-to-edge
|
|
333
|
-
/// Even when a parent container uses the wrapper mixin
|
|
334
|
-
@mixin breakout($v-padding: var(--space)) {
|
|
335
|
-
margin-left: calc(-50vw + 50%);
|
|
336
|
-
margin-right: calc(-50vw + 50%);
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
// Use the screenreader-only mixin for elements that you want to be visually hidden, but still want screenreaders to read out
|
|
340
|
-
@mixin screenreader-only() {
|
|
341
|
-
clip: rect(1px, 1px, 1px, 1px);
|
|
342
|
-
height: 1px;
|
|
343
|
-
overflow: hidden;
|
|
344
|
-
position: absolute !important;
|
|
345
|
-
width: 1px;
|
|
346
|
-
word-wrap: normal;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
//Convert pixel values to rem
|
|
350
|
-
@function to-rem($size) {
|
|
351
|
-
@return $size / 16px * 1rem;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
//Process a color variable so that it can be used in a data URI/URL
|
|
355
|
-
@function url-friendly-colour($colour) {
|
|
356
|
-
@return "%23" + str-slice("#{$colour}", 2, -1);
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
@mixin placeholder {
|
|
360
|
-
&::-webkit-input-placeholder {
|
|
361
|
-
@content;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
&::-moz-placeholder {
|
|
365
|
-
@content;
|
|
366
|
-
|
|
367
|
-
opacity: 1;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
&:-moz-placeholder {
|
|
371
|
-
@content;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
&:-ms-input-placeholder {
|
|
375
|
-
@content;
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
|