@mantine/core 7.9.2 → 7.10.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/cjs/components/Checkbox/Checkbox.cjs +5 -1
- package/cjs/components/Checkbox/Checkbox.cjs.map +1 -1
- package/cjs/components/Checkbox/CheckboxCard/CheckboxCard.cjs +84 -0
- package/cjs/components/Checkbox/CheckboxCard/CheckboxCard.cjs.map +1 -0
- package/cjs/components/Checkbox/CheckboxCard/CheckboxCard.context.cjs +21 -0
- package/cjs/components/Checkbox/CheckboxCard/CheckboxCard.context.cjs.map +1 -0
- package/cjs/components/Checkbox/CheckboxCard/CheckboxCard.module.css.cjs +7 -0
- package/cjs/components/Checkbox/CheckboxCard/CheckboxCard.module.css.cjs.map +1 -0
- package/cjs/components/Checkbox/CheckboxGroup/CheckboxGroup.cjs +1 -1
- package/cjs/components/Checkbox/CheckboxGroup/CheckboxGroup.cjs.map +1 -1
- package/cjs/components/Checkbox/CheckboxGroup.context.cjs.map +1 -1
- package/cjs/components/Checkbox/CheckboxIndicator/CheckboxIndicator.cjs +98 -0
- package/cjs/components/Checkbox/CheckboxIndicator/CheckboxIndicator.cjs.map +1 -0
- package/cjs/components/Checkbox/CheckboxIndicator/CheckboxIndicator.module.css.cjs +7 -0
- package/cjs/components/Checkbox/CheckboxIndicator/CheckboxIndicator.module.css.cjs.map +1 -0
- package/cjs/components/Chip/Chip.cjs +4 -0
- package/cjs/components/Chip/Chip.cjs.map +1 -1
- package/cjs/components/Combobox/OptionsDropdown/OptionsDropdown.cjs +4 -0
- package/cjs/components/Combobox/OptionsDropdown/OptionsDropdown.cjs.map +1 -1
- package/cjs/components/Indicator/Indicator.cjs +1 -1
- package/cjs/components/Indicator/Indicator.cjs.map +1 -1
- package/cjs/components/Input/Input.cjs +2 -0
- package/cjs/components/Input/Input.cjs.map +1 -1
- package/cjs/components/MultiSelect/filter-picked-values.cjs +4 -0
- package/cjs/components/MultiSelect/filter-picked-values.cjs.map +1 -1
- package/cjs/components/NativeSelect/NativeSelect.cjs +4 -0
- package/cjs/components/NativeSelect/NativeSelect.cjs.map +1 -1
- package/cjs/components/NumberInput/NumberInput.cjs +11 -3
- package/cjs/components/NumberInput/NumberInput.cjs.map +1 -1
- package/cjs/components/Pagination/PaginationRoot/PaginationRoot.cjs +1 -1
- package/cjs/components/Pagination/PaginationRoot/PaginationRoot.cjs.map +1 -1
- package/cjs/components/Progress/Progress.cjs.map +1 -1
- package/cjs/components/Progress/ProgressSection/ProgressSection.cjs +1 -1
- package/cjs/components/Progress/ProgressSection/ProgressSection.cjs.map +1 -1
- package/cjs/components/Radio/Radio.cjs +5 -1
- package/cjs/components/Radio/Radio.cjs.map +1 -1
- package/cjs/components/Radio/RadioCard/RadioCard.cjs +120 -0
- package/cjs/components/Radio/RadioCard/RadioCard.cjs.map +1 -0
- package/cjs/components/Radio/RadioCard/RadioCard.context.cjs +21 -0
- package/cjs/components/Radio/RadioCard/RadioCard.context.cjs.map +1 -0
- package/cjs/components/Radio/RadioCard/RadioCard.module.css.cjs +7 -0
- package/cjs/components/Radio/RadioCard/RadioCard.module.css.cjs.map +1 -0
- package/cjs/components/Radio/RadioGroup/RadioGroup.cjs +1 -1
- package/cjs/components/Radio/RadioGroup/RadioGroup.cjs.map +1 -1
- package/cjs/components/Radio/RadioGroup.context.cjs.map +1 -1
- package/cjs/components/Radio/RadioIndicator/RadioIndicator.cjs +98 -0
- package/cjs/components/Radio/RadioIndicator/RadioIndicator.cjs.map +1 -0
- package/cjs/components/Radio/RadioIndicator/RadioIndicator.module.css.cjs +7 -0
- package/cjs/components/Radio/RadioIndicator/RadioIndicator.module.css.cjs.map +1 -0
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarAuto.cjs.map +1 -1
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarHover.cjs.map +1 -1
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarVisible.cjs +5 -0
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarVisible.cjs.map +1 -1
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollbarY.cjs +4 -3
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollbarY.cjs.map +1 -1
- package/cjs/components/SegmentedControl/SegmentedControl.cjs +7 -5
- package/cjs/components/SegmentedControl/SegmentedControl.cjs.map +1 -1
- package/cjs/components/SimpleGrid/SimpleGrid.cjs +10 -2
- package/cjs/components/SimpleGrid/SimpleGrid.cjs.map +1 -1
- package/cjs/components/SimpleGrid/SimpleGrid.module.css.cjs +1 -1
- package/cjs/components/SimpleGrid/SimpleGridVariables.cjs +64 -2
- package/cjs/components/SimpleGrid/SimpleGridVariables.cjs.map +1 -1
- package/cjs/components/Stepper/Stepper.cjs +1 -1
- package/cjs/components/Stepper/Stepper.cjs.map +1 -1
- package/cjs/components/Stepper/StepperStep/StepperStep.cjs +4 -0
- package/cjs/components/Stepper/StepperStep/StepperStep.cjs.map +1 -1
- package/cjs/components/Tabs/Tabs.cjs +1 -1
- package/cjs/components/Tabs/Tabs.cjs.map +1 -1
- package/cjs/components/TagsInput/filter-picked-tags.cjs +4 -0
- package/cjs/components/TagsInput/filter-picked-tags.cjs.map +1 -1
- package/cjs/components/Timeline/Timeline.cjs +1 -1
- package/cjs/components/Timeline/Timeline.cjs.map +1 -1
- package/cjs/components/Tree/Tree.cjs +5 -2
- package/cjs/components/Tree/Tree.cjs.map +1 -1
- package/cjs/components/Tree/TreeNode.cjs +29 -5
- package/cjs/components/Tree/TreeNode.cjs.map +1 -1
- package/cjs/components/Tree/use-tree.cjs +4 -1
- package/cjs/components/Tree/use-tree.cjs.map +1 -1
- package/cjs/core/Box/Box.cjs +2 -0
- package/cjs/core/Box/Box.cjs.map +1 -1
- package/cjs/core/Box/style-props/extract-style-props/extract-style-props.cjs +2 -0
- package/cjs/core/Box/style-props/extract-style-props/extract-style-props.cjs.map +1 -1
- package/cjs/core/Box/style-props/resolvers/border-resolver/border-resolver.cjs +31 -0
- package/cjs/core/Box/style-props/resolvers/border-resolver/border-resolver.cjs.map +1 -0
- package/cjs/core/Box/style-props/resolvers/index.cjs +3 -1
- package/cjs/core/Box/style-props/resolvers/index.cjs.map +1 -1
- package/cjs/core/Box/style-props/style-props-data.cjs +1 -0
- package/cjs/core/Box/style-props/style-props-data.cjs.map +1 -1
- package/cjs/core/InlineStyles/InlineStyles.cjs +2 -2
- package/cjs/core/InlineStyles/InlineStyles.cjs.map +1 -1
- package/cjs/core/InlineStyles/styles-to-string/styles-to-string.cjs +5 -2
- package/cjs/core/InlineStyles/styles-to-string/styles-to-string.cjs.map +1 -1
- package/cjs/index.cjs +14 -0
- package/cjs/index.cjs.map +1 -1
- package/esm/components/Checkbox/Checkbox.mjs +5 -1
- package/esm/components/Checkbox/Checkbox.mjs.map +1 -1
- package/esm/components/Checkbox/CheckboxCard/CheckboxCard.context.mjs +18 -0
- package/esm/components/Checkbox/CheckboxCard/CheckboxCard.context.mjs.map +1 -0
- package/esm/components/Checkbox/CheckboxCard/CheckboxCard.mjs +82 -0
- package/esm/components/Checkbox/CheckboxCard/CheckboxCard.mjs.map +1 -0
- package/esm/components/Checkbox/CheckboxCard/CheckboxCard.module.css.mjs +5 -0
- package/esm/components/Checkbox/CheckboxCard/CheckboxCard.module.css.mjs.map +1 -0
- package/esm/components/Checkbox/CheckboxGroup/CheckboxGroup.mjs +1 -1
- package/esm/components/Checkbox/CheckboxGroup/CheckboxGroup.mjs.map +1 -1
- package/esm/components/Checkbox/CheckboxGroup.context.mjs.map +1 -1
- package/esm/components/Checkbox/CheckboxIndicator/CheckboxIndicator.mjs +96 -0
- package/esm/components/Checkbox/CheckboxIndicator/CheckboxIndicator.mjs.map +1 -0
- package/esm/components/Checkbox/CheckboxIndicator/CheckboxIndicator.module.css.mjs +5 -0
- package/esm/components/Checkbox/CheckboxIndicator/CheckboxIndicator.module.css.mjs.map +1 -0
- package/esm/components/Chip/Chip.mjs +4 -0
- package/esm/components/Chip/Chip.mjs.map +1 -1
- package/esm/components/Combobox/OptionsDropdown/OptionsDropdown.mjs +4 -0
- package/esm/components/Combobox/OptionsDropdown/OptionsDropdown.mjs.map +1 -1
- package/esm/components/Indicator/Indicator.mjs +1 -1
- package/esm/components/Indicator/Indicator.mjs.map +1 -1
- package/esm/components/Input/Input.mjs +2 -0
- package/esm/components/Input/Input.mjs.map +1 -1
- package/esm/components/MultiSelect/filter-picked-values.mjs +4 -0
- package/esm/components/MultiSelect/filter-picked-values.mjs.map +1 -1
- package/esm/components/NativeSelect/NativeSelect.mjs +4 -0
- package/esm/components/NativeSelect/NativeSelect.mjs.map +1 -1
- package/esm/components/NumberInput/NumberInput.mjs +11 -3
- package/esm/components/NumberInput/NumberInput.mjs.map +1 -1
- package/esm/components/Pagination/PaginationRoot/PaginationRoot.mjs +1 -1
- package/esm/components/Pagination/PaginationRoot/PaginationRoot.mjs.map +1 -1
- package/esm/components/Progress/Progress.mjs.map +1 -1
- package/esm/components/Progress/ProgressSection/ProgressSection.mjs +1 -1
- package/esm/components/Progress/ProgressSection/ProgressSection.mjs.map +1 -1
- package/esm/components/Radio/Radio.mjs +5 -1
- package/esm/components/Radio/Radio.mjs.map +1 -1
- package/esm/components/Radio/RadioCard/RadioCard.context.mjs +18 -0
- package/esm/components/Radio/RadioCard/RadioCard.context.mjs.map +1 -0
- package/esm/components/Radio/RadioCard/RadioCard.mjs +118 -0
- package/esm/components/Radio/RadioCard/RadioCard.mjs.map +1 -0
- package/esm/components/Radio/RadioCard/RadioCard.module.css.mjs +5 -0
- package/esm/components/Radio/RadioCard/RadioCard.module.css.mjs.map +1 -0
- package/esm/components/Radio/RadioGroup/RadioGroup.mjs +1 -1
- package/esm/components/Radio/RadioGroup/RadioGroup.mjs.map +1 -1
- package/esm/components/Radio/RadioGroup.context.mjs.map +1 -1
- package/esm/components/Radio/RadioIndicator/RadioIndicator.mjs +96 -0
- package/esm/components/Radio/RadioIndicator/RadioIndicator.mjs.map +1 -0
- package/esm/components/Radio/RadioIndicator/RadioIndicator.module.css.mjs +5 -0
- package/esm/components/Radio/RadioIndicator/RadioIndicator.module.css.mjs.map +1 -0
- package/esm/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarAuto.mjs.map +1 -1
- package/esm/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarHover.mjs.map +1 -1
- package/esm/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarVisible.mjs +5 -0
- package/esm/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarVisible.mjs.map +1 -1
- package/esm/components/ScrollArea/ScrollAreaScrollbar/ScrollbarY.mjs +4 -3
- package/esm/components/ScrollArea/ScrollAreaScrollbar/ScrollbarY.mjs.map +1 -1
- package/esm/components/SegmentedControl/SegmentedControl.mjs +7 -5
- package/esm/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
- package/esm/components/SimpleGrid/SimpleGrid.mjs +11 -3
- package/esm/components/SimpleGrid/SimpleGrid.mjs.map +1 -1
- package/esm/components/SimpleGrid/SimpleGrid.module.css.mjs +1 -1
- package/esm/components/SimpleGrid/SimpleGridVariables.mjs +63 -2
- package/esm/components/SimpleGrid/SimpleGridVariables.mjs.map +1 -1
- package/esm/components/Stepper/Stepper.mjs +1 -1
- package/esm/components/Stepper/Stepper.mjs.map +1 -1
- package/esm/components/Stepper/StepperStep/StepperStep.mjs +4 -0
- package/esm/components/Stepper/StepperStep/StepperStep.mjs.map +1 -1
- package/esm/components/Tabs/Tabs.mjs +1 -1
- package/esm/components/Tabs/Tabs.mjs.map +1 -1
- package/esm/components/TagsInput/filter-picked-tags.mjs +4 -0
- package/esm/components/TagsInput/filter-picked-tags.mjs.map +1 -1
- package/esm/components/Timeline/Timeline.mjs +1 -1
- package/esm/components/Timeline/Timeline.mjs.map +1 -1
- package/esm/components/Tree/Tree.mjs +5 -2
- package/esm/components/Tree/Tree.mjs.map +1 -1
- package/esm/components/Tree/TreeNode.mjs +29 -5
- package/esm/components/Tree/TreeNode.mjs.map +1 -1
- package/esm/components/Tree/use-tree.mjs +4 -1
- package/esm/components/Tree/use-tree.mjs.map +1 -1
- package/esm/core/Box/Box.mjs +2 -0
- package/esm/core/Box/Box.mjs.map +1 -1
- package/esm/core/Box/style-props/extract-style-props/extract-style-props.mjs +2 -0
- package/esm/core/Box/style-props/extract-style-props/extract-style-props.mjs.map +1 -1
- package/esm/core/Box/style-props/resolvers/border-resolver/border-resolver.mjs +29 -0
- package/esm/core/Box/style-props/resolvers/border-resolver/border-resolver.mjs.map +1 -0
- package/esm/core/Box/style-props/resolvers/index.mjs +3 -1
- package/esm/core/Box/style-props/resolvers/index.mjs.map +1 -1
- package/esm/core/Box/style-props/style-props-data.mjs +1 -0
- package/esm/core/Box/style-props/style-props-data.mjs.map +1 -1
- package/esm/core/InlineStyles/InlineStyles.mjs +2 -2
- package/esm/core/InlineStyles/InlineStyles.mjs.map +1 -1
- package/esm/core/InlineStyles/styles-to-string/styles-to-string.mjs +5 -2
- package/esm/core/InlineStyles/styles-to-string/styles-to-string.mjs.map +1 -1
- package/esm/index.mjs +7 -0
- package/esm/index.mjs.map +1 -1
- package/lib/components/Checkbox/Checkbox.d.ts +6 -0
- package/lib/components/Checkbox/CheckboxCard/CheckboxCard.context.d.ts +7 -0
- package/lib/components/Checkbox/CheckboxCard/CheckboxCard.d.ts +27 -0
- package/lib/components/Checkbox/CheckboxGroup.context.d.ts +1 -1
- package/lib/components/Checkbox/CheckboxIndicator/CheckboxIndicator.d.ts +43 -0
- package/lib/components/Checkbox/index.d.ts +7 -0
- package/lib/components/Input/Input.d.ts +2 -0
- package/lib/components/NumberInput/NumberInput.d.ts +3 -1
- package/lib/components/Progress/Progress.d.ts +1 -1
- package/lib/components/Progress/ProgressSection/ProgressSection.d.ts +1 -1
- package/lib/components/Radio/Radio.d.ts +7 -1
- package/lib/components/Radio/RadioCard/RadioCard.context.d.ts +7 -0
- package/lib/components/Radio/RadioCard/RadioCard.d.ts +29 -0
- package/lib/components/Radio/RadioGroup.context.d.ts +1 -1
- package/lib/components/Radio/RadioIndicator/RadioIndicator.d.ts +39 -0
- package/lib/components/Radio/index.d.ts +6 -0
- package/lib/components/SimpleGrid/SimpleGrid.d.ts +3 -1
- package/lib/components/SimpleGrid/SimpleGridVariables.d.ts +2 -1
- package/lib/components/Tree/Tree.d.ts +11 -2
- package/lib/components/Tree/TreeNode.d.ts +2 -1
- package/lib/components/Tree/index.d.ts +2 -2
- package/lib/components/Tree/use-tree.d.ts +30 -4
- package/lib/core/Box/Box.d.ts +2 -0
- package/lib/core/Box/style-props/resolvers/border-resolver/border-resolver.d.ts +2 -0
- package/lib/core/Box/style-props/resolvers/index.d.ts +2 -0
- package/lib/core/Box/style-props/style-props.types.d.ts +1 -0
- package/lib/core/InlineStyles/InlineStyles.d.ts +1 -1
- package/lib/core/InlineStyles/styles-to-string/styles-to-string.d.ts +2 -1
- package/package.json +4 -4
- package/styles/CheckboxCard.css +24 -0
- package/styles/CheckboxCard.layer.css +25 -0
- package/styles/CheckboxIndicator.css +95 -0
- package/styles/CheckboxIndicator.layer.css +96 -0
- package/styles/RadioCard.css +24 -0
- package/styles/RadioCard.layer.css +25 -0
- package/styles/RadioIndicator.css +103 -0
- package/styles/RadioIndicator.layer.css +104 -0
- package/styles/SimpleGrid.css +4 -0
- package/styles/SimpleGrid.layer.css +5 -1
- package/styles.css +254 -0
- package/styles.layer.css +254 -0
|
@@ -9,14 +9,14 @@ import '../MantineProvider/MantineThemeProvider/MantineThemeProvider.mjs';
|
|
|
9
9
|
import '../MantineProvider/MantineCssVariables/MantineCssVariables.mjs';
|
|
10
10
|
import { stylesToString } from './styles-to-string/styles-to-string.mjs';
|
|
11
11
|
|
|
12
|
-
function InlineStyles(
|
|
12
|
+
function InlineStyles(props) {
|
|
13
13
|
const nonce = useMantineStyleNonce();
|
|
14
14
|
return /* @__PURE__ */ jsx(
|
|
15
15
|
"style",
|
|
16
16
|
{
|
|
17
17
|
"data-mantine-styles": "inline",
|
|
18
18
|
nonce: nonce?.(),
|
|
19
|
-
dangerouslySetInnerHTML: { __html: stylesToString(
|
|
19
|
+
dangerouslySetInnerHTML: { __html: stylesToString(props) }
|
|
20
20
|
}
|
|
21
21
|
);
|
|
22
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineStyles.mjs","sources":["../../../src/core/InlineStyles/InlineStyles.tsx"],"sourcesContent":["import { useMantineStyleNonce } from '../MantineProvider';\nimport { InlineStylesInput, stylesToString } from './styles-to-string/styles-to-string';\n\nexport interface InlineStylesProps\n extends InlineStylesInput,\n Omit<React.ComponentPropsWithoutRef<'style'>, keyof InlineStylesInput> {}\n\nexport function InlineStyles(
|
|
1
|
+
{"version":3,"file":"InlineStyles.mjs","sources":["../../../src/core/InlineStyles/InlineStyles.tsx"],"sourcesContent":["import { useMantineStyleNonce } from '../MantineProvider';\nimport { InlineStylesInput, stylesToString } from './styles-to-string/styles-to-string';\n\nexport interface InlineStylesProps\n extends InlineStylesInput,\n Omit<React.ComponentPropsWithoutRef<'style'>, keyof InlineStylesInput> {}\n\nexport function InlineStyles(props: InlineStylesInput) {\n const nonce = useMantineStyleNonce();\n return (\n <style\n data-mantine-styles=\"inline\"\n nonce={nonce?.()}\n dangerouslySetInnerHTML={{ __html: stylesToString(props) }}\n />\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAIO,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAC,CAAA,CAAA,CAAA,CAAA,CAAK,CAAE,CAAA,CAAA;AACpC,CAAA,CAAE,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAoB,EAAE,CAAC;AACvC,CAAA,CAAE,uBAAuB,CAAG,CAAA,CAAA,CAAA;AAC5B,CAAA,CAAA,CAAA,CAAI,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACX,CAAI,CAAA,CAAA,CAAA,CAAA;AACJ,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqB,EAAE,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACrC,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAI,CAAA,CAAA,CAAA,CAAA;AACtB,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuB,EAAE,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,EAAE,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,CAAK,CAAA,CAAA,CAAA,CAAA,CAAC,CAAE,CAAA;AAChE,CAAK,CAAA,CAAA,CAAA,CAAA;AACL,CAAA,CAAA,CAAG,CAAC;AACJ,CAAA;;"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { cssObjectToString } from '../css-object-to-string/css-object-to-string.mjs';
|
|
3
3
|
|
|
4
|
-
function stylesToString({ selector, styles, media }) {
|
|
4
|
+
function stylesToString({ selector, styles, media, container }) {
|
|
5
5
|
const baseStyles = styles ? cssObjectToString(styles) : "";
|
|
6
6
|
const mediaQueryStyles = !Array.isArray(media) ? [] : media.map((item) => `@media${item.query}{${selector}{${cssObjectToString(item.styles)}}}`);
|
|
7
|
-
|
|
7
|
+
const containerStyles = !Array.isArray(container) ? [] : container.map(
|
|
8
|
+
(item) => `@container ${item.query}{${selector}{${cssObjectToString(item.styles)}}}`
|
|
9
|
+
);
|
|
10
|
+
return `${baseStyles ? `${selector}{${baseStyles}}` : ""}${mediaQueryStyles.join("")}${containerStyles.join("")}`.trim();
|
|
8
11
|
}
|
|
9
12
|
|
|
10
13
|
export { stylesToString };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles-to-string.mjs","sources":["../../../../src/core/InlineStyles/styles-to-string/styles-to-string.ts"],"sourcesContent":["import { cssObjectToString } from '../css-object-to-string/css-object-to-string';\n\nexport interface InlineStylesMediaQuery {\n query: string;\n styles: React.CSSProperties;\n}\n\nexport interface InlineStylesInput {\n selector: string;\n styles?: React.CSSProperties;\n media?: InlineStylesMediaQuery[];\n}\n\nexport function stylesToString({ selector, styles, media }: InlineStylesInput) {\n const baseStyles = styles ? cssObjectToString(styles) : '';\n const mediaQueryStyles = !Array.isArray(media)\n ? []\n : media.map((item) => `@media${item.query}{${selector}{${cssObjectToString(item.styles)}}}`);\n\n return `${baseStyles ? `${selector}{${baseStyles}}` : ''}${mediaQueryStyles.join('')}`.trim();\n}\n"],"names":[],"mappings":";;;AAEO,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAC,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"styles-to-string.mjs","sources":["../../../../src/core/InlineStyles/styles-to-string/styles-to-string.ts"],"sourcesContent":["import { cssObjectToString } from '../css-object-to-string/css-object-to-string';\n\nexport interface InlineStylesMediaQuery {\n query: string;\n styles: React.CSSProperties;\n}\n\nexport interface InlineStylesInput {\n selector: string;\n styles?: React.CSSProperties;\n media?: InlineStylesMediaQuery[];\n container?: InlineStylesMediaQuery[];\n}\n\nexport function stylesToString({ selector, styles, media, container }: InlineStylesInput) {\n const baseStyles = styles ? cssObjectToString(styles) : '';\n const mediaQueryStyles = !Array.isArray(media)\n ? []\n : media.map((item) => `@media${item.query}{${selector}{${cssObjectToString(item.styles)}}}`);\n\n const containerStyles = !Array.isArray(container)\n ? []\n : container.map(\n (item) => `@container ${item.query}{${selector}{${cssObjectToString(item.styles)}}}`\n );\n\n return `${baseStyles ? `${selector}{${baseStyles}}` : ''}${mediaQueryStyles.join('')}${containerStyles.join('')}`.trim();\n}\n"],"names":[],"mappings":"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"}
|
package/esm/index.mjs
CHANGED
|
@@ -142,6 +142,10 @@ export { Center } from './components/Center/Center.mjs';
|
|
|
142
142
|
export { Checkbox } from './components/Checkbox/Checkbox.mjs';
|
|
143
143
|
export { CheckboxGroup } from './components/Checkbox/CheckboxGroup/CheckboxGroup.mjs';
|
|
144
144
|
export { CheckIcon } from './components/Checkbox/CheckIcon.mjs';
|
|
145
|
+
export { CheckboxIndicator } from './components/Checkbox/CheckboxIndicator/CheckboxIndicator.mjs';
|
|
146
|
+
export { CheckboxCard } from './components/Checkbox/CheckboxCard/CheckboxCard.mjs';
|
|
147
|
+
export { useCheckboxCardContext } from './components/Checkbox/CheckboxCard/CheckboxCard.context.mjs';
|
|
148
|
+
export { useCheckboxGroupContext } from './components/Checkbox/CheckboxGroup.context.mjs';
|
|
145
149
|
export { Chip } from './components/Chip/Chip.mjs';
|
|
146
150
|
export { ChipGroup } from './components/Chip/ChipGroup/ChipGroup.mjs';
|
|
147
151
|
export { Code } from './components/Code/Code.mjs';
|
|
@@ -250,6 +254,9 @@ export { ProgressSection } from './components/Progress/ProgressSection/ProgressS
|
|
|
250
254
|
export { Radio } from './components/Radio/Radio.mjs';
|
|
251
255
|
export { RadioGroup } from './components/Radio/RadioGroup/RadioGroup.mjs';
|
|
252
256
|
export { RadioIcon } from './components/Radio/RadioIcon.mjs';
|
|
257
|
+
export { RadioCard } from './components/Radio/RadioCard/RadioCard.mjs';
|
|
258
|
+
export { useRadioCardContext } from './components/Radio/RadioCard/RadioCard.context.mjs';
|
|
259
|
+
export { RadioIndicator } from './components/Radio/RadioIndicator/RadioIndicator.mjs';
|
|
253
260
|
export { Rating } from './components/Rating/Rating.mjs';
|
|
254
261
|
export { RingProgress } from './components/RingProgress/RingProgress.mjs';
|
|
255
262
|
export { SegmentedControl } from './components/SegmentedControl/SegmentedControl.mjs';
|
package/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { BoxProps, ElementProps, Factory, MantineColor, MantineRadius, MantineSize, StylesApiProps } from '../../core';
|
|
2
2
|
import { InlineInputStylesNames } from '../InlineInput';
|
|
3
|
+
import { CheckboxCard } from './CheckboxCard/CheckboxCard';
|
|
3
4
|
import { CheckboxGroup } from './CheckboxGroup/CheckboxGroup';
|
|
5
|
+
import { CheckboxIndicator } from './CheckboxIndicator/CheckboxIndicator';
|
|
4
6
|
export type CheckboxVariant = 'filled' | 'outline';
|
|
5
7
|
export type CheckboxStylesNames = 'icon' | 'inner' | 'input' | InlineInputStylesNames;
|
|
6
8
|
export type CheckboxCssVariables = {
|
|
@@ -47,6 +49,8 @@ export type CheckboxFactory = Factory<{
|
|
|
47
49
|
variant: CheckboxVariant;
|
|
48
50
|
staticComponents: {
|
|
49
51
|
Group: typeof CheckboxGroup;
|
|
52
|
+
Indicator: typeof CheckboxIndicator;
|
|
53
|
+
Card: typeof CheckboxCard;
|
|
50
54
|
};
|
|
51
55
|
}>;
|
|
52
56
|
export declare const Checkbox: import("../../core").MantineComponent<{
|
|
@@ -57,5 +61,7 @@ export declare const Checkbox: import("../../core").MantineComponent<{
|
|
|
57
61
|
variant: CheckboxVariant;
|
|
58
62
|
staticComponents: {
|
|
59
63
|
Group: typeof CheckboxGroup;
|
|
64
|
+
Indicator: typeof CheckboxIndicator;
|
|
65
|
+
Card: typeof CheckboxCard;
|
|
60
66
|
};
|
|
61
67
|
}>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface CheckboxCardContextValue {
|
|
2
|
+
checked: boolean;
|
|
3
|
+
}
|
|
4
|
+
export declare const CheckboxCardProvider: ({ children, value }: {
|
|
5
|
+
value: CheckboxCardContextValue;
|
|
6
|
+
children: import("react").ReactNode;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element, useCheckboxCardContext: () => CheckboxCardContextValue | null;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { BoxProps, ElementProps, Factory, MantineRadius, StylesApiProps } from '../../../core';
|
|
2
|
+
export type CheckboxCardStylesNames = 'card';
|
|
3
|
+
export type CheckboxCardCssVariables = {
|
|
4
|
+
card: '--card-radius';
|
|
5
|
+
};
|
|
6
|
+
export interface CheckboxCardProps extends BoxProps, StylesApiProps<CheckboxCardFactory>, ElementProps<'button', 'onChange'> {
|
|
7
|
+
/** Checked state */
|
|
8
|
+
checked?: boolean;
|
|
9
|
+
/** Determines whether the card should have border, `true` by default */
|
|
10
|
+
withBorder?: boolean;
|
|
11
|
+
/** Key of `theme.radius` or any valid CSS value to set `border-radius`, numbers are converted to rem, `theme.defaultRadius` by default */
|
|
12
|
+
radius?: MantineRadius;
|
|
13
|
+
/** Value of the checkbox, used with `Checkbox.Group` */
|
|
14
|
+
value?: string;
|
|
15
|
+
}
|
|
16
|
+
export type CheckboxCardFactory = Factory<{
|
|
17
|
+
props: CheckboxCardProps;
|
|
18
|
+
ref: HTMLButtonElement;
|
|
19
|
+
stylesNames: CheckboxCardStylesNames;
|
|
20
|
+
vars: CheckboxCardCssVariables;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const CheckboxCard: import("../../../core").MantineComponent<{
|
|
23
|
+
props: CheckboxCardProps;
|
|
24
|
+
ref: HTMLButtonElement;
|
|
25
|
+
stylesNames: CheckboxCardStylesNames;
|
|
26
|
+
vars: CheckboxCardCssVariables;
|
|
27
|
+
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MantineSize } from '../../core';
|
|
2
2
|
interface CheckboxGroupContextValue {
|
|
3
3
|
value: string[];
|
|
4
|
-
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
4
|
+
onChange: (event: React.ChangeEvent<HTMLInputElement> | string) => void;
|
|
5
5
|
size: MantineSize | (string & {}) | undefined;
|
|
6
6
|
}
|
|
7
7
|
export declare const CheckboxGroupProvider: import("react").Provider<CheckboxGroupContextValue | null>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { BoxProps, ElementProps, Factory, MantineColor, MantineRadius, MantineSize, StylesApiProps } from '../../../core';
|
|
2
|
+
export type CheckboxIndicatorStylesNames = 'indicator' | 'icon';
|
|
3
|
+
export type CheckboxIndicatorVariant = 'filled' | 'outline';
|
|
4
|
+
export type CheckboxIndicatorCssVariables = {
|
|
5
|
+
indicator: '--checkbox-size' | '--checkbox-radius' | '--checkbox-color' | '--checkbox-icon-color';
|
|
6
|
+
};
|
|
7
|
+
export interface CheckboxIndicatorProps extends BoxProps, StylesApiProps<CheckboxIndicatorFactory>, ElementProps<'div'> {
|
|
8
|
+
/** Key of `theme.colors` or any valid CSS color to set input background color in checked state, `theme.primaryColor` by default */
|
|
9
|
+
color?: MantineColor;
|
|
10
|
+
/** Controls size of the component, `'sm'` by default */
|
|
11
|
+
size?: MantineSize | (string & {});
|
|
12
|
+
/** Key of `theme.radius` or any valid CSS value to set `border-radius,` `theme.defaultRadius` by default */
|
|
13
|
+
radius?: MantineRadius;
|
|
14
|
+
/** Key of `theme.colors` or any valid CSS color to set icon color, by default value depends on `theme.autoContrast` */
|
|
15
|
+
iconColor?: MantineColor;
|
|
16
|
+
/** Determines whether icon color with filled variant should depend on `background-color`. If luminosity of the `color` prop is less than `theme.luminosityThreshold`, then `theme.white` will be used for text color, otherwise `theme.black`. Overrides `theme.autoContrast`. */
|
|
17
|
+
autoContrast?: boolean;
|
|
18
|
+
/** Indeterminate state of the checkbox. If set, `checked` prop is ignored. */
|
|
19
|
+
indeterminate?: boolean;
|
|
20
|
+
/** Icon displayed when checkbox is in checked or indeterminate state */
|
|
21
|
+
icon?: React.FC<{
|
|
22
|
+
indeterminate: boolean | undefined;
|
|
23
|
+
className: string;
|
|
24
|
+
}>;
|
|
25
|
+
/** Determines whether the component should have checked styles */
|
|
26
|
+
checked?: boolean;
|
|
27
|
+
/** Determines whether the component should have disabled styles */
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export type CheckboxIndicatorFactory = Factory<{
|
|
31
|
+
props: CheckboxIndicatorProps;
|
|
32
|
+
ref: HTMLDivElement;
|
|
33
|
+
stylesNames: CheckboxIndicatorStylesNames;
|
|
34
|
+
vars: CheckboxIndicatorCssVariables;
|
|
35
|
+
variant: CheckboxIndicatorVariant;
|
|
36
|
+
}>;
|
|
37
|
+
export declare const CheckboxIndicator: import("../../../core").MantineComponent<{
|
|
38
|
+
props: CheckboxIndicatorProps;
|
|
39
|
+
ref: HTMLDivElement;
|
|
40
|
+
stylesNames: CheckboxIndicatorStylesNames;
|
|
41
|
+
vars: CheckboxIndicatorCssVariables;
|
|
42
|
+
variant: CheckboxIndicatorVariant;
|
|
43
|
+
}>;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
export { Checkbox } from './Checkbox';
|
|
2
2
|
export { CheckboxGroup } from './CheckboxGroup/CheckboxGroup';
|
|
3
3
|
export { CheckIcon } from './CheckIcon';
|
|
4
|
+
export { CheckboxIndicator } from './CheckboxIndicator/CheckboxIndicator';
|
|
5
|
+
export { CheckboxCard } from './CheckboxCard/CheckboxCard';
|
|
6
|
+
export { useCheckboxCardContext } from './CheckboxCard/CheckboxCard.context';
|
|
7
|
+
export { useCheckboxGroupContext } from './CheckboxGroup.context';
|
|
4
8
|
export type { CheckboxIconProps, CheckIconProps } from './CheckIcon';
|
|
9
|
+
export type { CheckboxCardContextValue } from './CheckboxCard/CheckboxCard.context';
|
|
5
10
|
export type { CheckboxCssVariables, CheckboxFactory, CheckboxProps, CheckboxStylesNames, CheckboxVariant, } from './Checkbox';
|
|
6
11
|
export type { CheckboxGroupFactory, CheckboxGroupProps, CheckboxGroupStylesNames, } from './CheckboxGroup/CheckboxGroup';
|
|
12
|
+
export type { CheckboxIndicatorCssVariables, CheckboxIndicatorFactory, CheckboxIndicatorProps, CheckboxIndicatorStylesNames, CheckboxIndicatorVariant, } from './CheckboxIndicator/CheckboxIndicator';
|
|
13
|
+
export type { CheckboxCardCssVariables, CheckboxCardProps, CheckboxCardFactory, CheckboxCardStylesNames, } from './CheckboxCard/CheckboxCard';
|
|
@@ -49,6 +49,8 @@ export interface __InputProps {
|
|
|
49
49
|
pointer?: boolean;
|
|
50
50
|
/** Determines whether the input should have red border and red text color when the `error` prop is set, `true` by default */
|
|
51
51
|
withErrorStyles?: boolean;
|
|
52
|
+
/** `size` prop added to the input element */
|
|
53
|
+
inputSize?: string;
|
|
52
54
|
}
|
|
53
55
|
export interface InputProps extends BoxProps, __InputProps, StylesApiProps<InputFactory> {
|
|
54
56
|
__staticSelector?: string;
|
|
@@ -18,7 +18,7 @@ export interface NumberInputProps extends BoxProps, __BaseInputProps, StylesApiP
|
|
|
18
18
|
onChange?: (value: number | string) => void;
|
|
19
19
|
/** Called when value changes with `react-number-format` payload */
|
|
20
20
|
onValueChange?: OnValueChange;
|
|
21
|
-
/** Determines whether leading zeros are allowed. If
|
|
21
|
+
/** Determines whether leading zeros are allowed. If set to `false`, leading zeros are removed when the input value becomes a valid number. `true` by default */
|
|
22
22
|
allowLeadingZeros?: boolean;
|
|
23
23
|
/** Determines whether negative values are allowed, `true` by default */
|
|
24
24
|
allowNegative?: boolean;
|
|
@@ -66,6 +66,8 @@ export interface NumberInputProps extends BoxProps, __BaseInputProps, StylesApiP
|
|
|
66
66
|
stepHoldDelay?: number;
|
|
67
67
|
/** Determines whether up/down keyboard events should be handled to increment/decrement value, `true` by default */
|
|
68
68
|
withKeyboardEvents?: boolean;
|
|
69
|
+
/** Determines whether leading zeros (e.g. `00100` -> `100`) should be removed on blur, `true` by default */
|
|
70
|
+
trimLeadingZeroesOnBlur?: boolean;
|
|
69
71
|
}
|
|
70
72
|
export type NumberInputFactory = Factory<{
|
|
71
73
|
props: NumberInputProps;
|
|
@@ -8,7 +8,7 @@ export interface ProgressProps extends __ProgressRootProps, StylesApiProps<Progr
|
|
|
8
8
|
value: number;
|
|
9
9
|
/** Key of `theme.colors` or any valid CSS value, `theme.primaryColor` by default */
|
|
10
10
|
color?: MantineColor;
|
|
11
|
-
/** Determines whether the section should have
|
|
11
|
+
/** Determines whether the section should have stripes, `false` by default */
|
|
12
12
|
striped?: boolean;
|
|
13
13
|
/** Determines whether the sections stripes should be animated, if set, `striped` prop is ignored, `false` by default */
|
|
14
14
|
animated?: boolean;
|
|
@@ -7,7 +7,7 @@ export interface ProgressSectionProps extends BoxProps, CompoundStylesApiProps<P
|
|
|
7
7
|
withAria?: boolean;
|
|
8
8
|
/** Key of `theme.colors` or any valid CSS value, `theme.primaryColor` by default */
|
|
9
9
|
color?: MantineColor;
|
|
10
|
-
/** Determines whether the section should have
|
|
10
|
+
/** Determines whether the section should have stripes, `false` by default */
|
|
11
11
|
striped?: boolean;
|
|
12
12
|
/** Determines whether the sections stripes should be animated, if set, `striped` prop is ignored, `false` by default */
|
|
13
13
|
animated?: boolean;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { BoxProps, ElementProps, Factory, MantineColor, MantineRadius, MantineSize, StylesApiProps } from '../../core';
|
|
2
2
|
import { InlineInputStylesNames } from '../InlineInput';
|
|
3
|
+
import { RadioCard } from './RadioCard/RadioCard';
|
|
3
4
|
import { RadioGroup } from './RadioGroup/RadioGroup';
|
|
4
5
|
import { RadioIconProps } from './RadioIcon';
|
|
6
|
+
import { RadioIndicator } from './RadioIndicator/RadioIndicator';
|
|
5
7
|
export type RadioVariant = 'filled' | 'outline';
|
|
6
8
|
export type RadioStylesNames = InlineInputStylesNames | 'inner' | 'radio' | 'icon';
|
|
7
9
|
export type RadioCssVariables = {
|
|
@@ -13,7 +15,7 @@ export interface RadioProps extends BoxProps, StylesApiProps<RadioFactory>, Elem
|
|
|
13
15
|
/** Key of `theme.colors` or any valid CSS color to set input color in checked state, `theme.primaryColor` by default */
|
|
14
16
|
color?: MantineColor;
|
|
15
17
|
/** Controls size of the component, `'sm'` by default */
|
|
16
|
-
size?: MantineSize;
|
|
18
|
+
size?: MantineSize | (string & {});
|
|
17
19
|
/** A component that replaces default check icon */
|
|
18
20
|
icon?: React.FC<RadioIconProps>;
|
|
19
21
|
/** Props passed down to the root element */
|
|
@@ -41,6 +43,8 @@ export type RadioFactory = Factory<{
|
|
|
41
43
|
variant: RadioVariant;
|
|
42
44
|
staticComponents: {
|
|
43
45
|
Group: typeof RadioGroup;
|
|
46
|
+
Card: typeof RadioCard;
|
|
47
|
+
Indicator: typeof RadioIndicator;
|
|
44
48
|
};
|
|
45
49
|
}>;
|
|
46
50
|
export declare const Radio: import("../../core").MantineComponent<{
|
|
@@ -51,5 +55,7 @@ export declare const Radio: import("../../core").MantineComponent<{
|
|
|
51
55
|
variant: RadioVariant;
|
|
52
56
|
staticComponents: {
|
|
53
57
|
Group: typeof RadioGroup;
|
|
58
|
+
Card: typeof RadioCard;
|
|
59
|
+
Indicator: typeof RadioIndicator;
|
|
54
60
|
};
|
|
55
61
|
}>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface RadioCardContextValue {
|
|
2
|
+
checked: boolean;
|
|
3
|
+
}
|
|
4
|
+
export declare const RadioCardProvider: ({ children, value }: {
|
|
5
|
+
value: RadioCardContextValue;
|
|
6
|
+
children: import("react").ReactNode;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element, useRadioCardContext: () => RadioCardContextValue | null;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { BoxProps, ElementProps, Factory, MantineRadius, StylesApiProps } from '../../../core';
|
|
2
|
+
export type RadioCardStylesNames = 'card';
|
|
3
|
+
export type RadioCardCssVariables = {
|
|
4
|
+
card: '--card-radius';
|
|
5
|
+
};
|
|
6
|
+
export interface RadioCardProps extends BoxProps, StylesApiProps<RadioCardFactory>, ElementProps<'button', 'onChange'> {
|
|
7
|
+
/** Checked state */
|
|
8
|
+
checked?: boolean;
|
|
9
|
+
/** Determines whether the card should have border, `true` by default */
|
|
10
|
+
withBorder?: boolean;
|
|
11
|
+
/** Key of `theme.radius` or any valid CSS value to set `border-radius`, numbers are converted to rem, `theme.defaultRadius` by default */
|
|
12
|
+
radius?: MantineRadius;
|
|
13
|
+
/** Value of the checkbox, used with `Radio.Group` */
|
|
14
|
+
value?: string;
|
|
15
|
+
/** Value used to associate all related radio cards, required for accessibility if used outside of `Radio.Group` */
|
|
16
|
+
name?: string;
|
|
17
|
+
}
|
|
18
|
+
export type RadioCardFactory = Factory<{
|
|
19
|
+
props: RadioCardProps;
|
|
20
|
+
ref: HTMLButtonElement;
|
|
21
|
+
stylesNames: RadioCardStylesNames;
|
|
22
|
+
vars: RadioCardCssVariables;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const RadioCard: import("../../../core").MantineComponent<{
|
|
25
|
+
props: RadioCardProps;
|
|
26
|
+
ref: HTMLButtonElement;
|
|
27
|
+
stylesNames: RadioCardStylesNames;
|
|
28
|
+
vars: RadioCardCssVariables;
|
|
29
|
+
}>;
|
|
@@ -2,7 +2,7 @@ import { MantineSize } from '../../core';
|
|
|
2
2
|
interface RadioGroupContextValue {
|
|
3
3
|
size: MantineSize | undefined;
|
|
4
4
|
value: string;
|
|
5
|
-
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
5
|
+
onChange: (event: React.ChangeEvent<HTMLInputElement> | string) => void;
|
|
6
6
|
name: string;
|
|
7
7
|
}
|
|
8
8
|
export declare const RadioGroupProvider: ({ children, value }: {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { BoxProps, ElementProps, Factory, MantineColor, MantineRadius, MantineSize, StylesApiProps } from '../../../core';
|
|
2
|
+
import { RadioIconProps } from '../RadioIcon';
|
|
3
|
+
export type RadioIndicatorStylesNames = 'indicator' | 'icon';
|
|
4
|
+
export type RadioIndicatorVariant = 'filled' | 'outline';
|
|
5
|
+
export type RadioIndicatorCssVariables = {
|
|
6
|
+
indicator: '--radio-size' | '--radio-radius' | '--radio-color' | '--radio-icon-color' | '--radio-icon-size';
|
|
7
|
+
};
|
|
8
|
+
export interface RadioIndicatorProps extends BoxProps, StylesApiProps<RadioIndicatorFactory>, ElementProps<'div'> {
|
|
9
|
+
/** Key of `theme.colors` or any valid CSS color to set input background color in checked state, `theme.primaryColor` by default */
|
|
10
|
+
color?: MantineColor;
|
|
11
|
+
/** Controls size of the component, `'sm'` by default */
|
|
12
|
+
size?: MantineSize | (string & {});
|
|
13
|
+
/** Key of `theme.radius` or any valid CSS value to set `border-radius,` `theme.defaultRadius` by default */
|
|
14
|
+
radius?: MantineRadius;
|
|
15
|
+
/** Key of `theme.colors` or any valid CSS color to set icon color, by default value depends on `theme.autoContrast` */
|
|
16
|
+
iconColor?: MantineColor;
|
|
17
|
+
/** Determines whether icon color with filled variant should depend on `background-color`. If luminosity of the `color` prop is less than `theme.luminosityThreshold`, then `theme.white` will be used for text color, otherwise `theme.black`. Overrides `theme.autoContrast`. */
|
|
18
|
+
autoContrast?: boolean;
|
|
19
|
+
/** A component that replaces default check icon */
|
|
20
|
+
icon?: React.FC<RadioIconProps>;
|
|
21
|
+
/** Determines whether the component should have checked styles */
|
|
22
|
+
checked?: boolean;
|
|
23
|
+
/** Determines whether the component should have disabled styles */
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export type RadioIndicatorFactory = Factory<{
|
|
27
|
+
props: RadioIndicatorProps;
|
|
28
|
+
ref: HTMLDivElement;
|
|
29
|
+
stylesNames: RadioIndicatorStylesNames;
|
|
30
|
+
vars: RadioIndicatorCssVariables;
|
|
31
|
+
variant: RadioIndicatorVariant;
|
|
32
|
+
}>;
|
|
33
|
+
export declare const RadioIndicator: import("../../../core").MantineComponent<{
|
|
34
|
+
props: RadioIndicatorProps;
|
|
35
|
+
ref: HTMLDivElement;
|
|
36
|
+
stylesNames: RadioIndicatorStylesNames;
|
|
37
|
+
vars: RadioIndicatorCssVariables;
|
|
38
|
+
variant: RadioIndicatorVariant;
|
|
39
|
+
}>;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
export { Radio } from './Radio';
|
|
2
2
|
export { RadioGroup } from './RadioGroup/RadioGroup';
|
|
3
3
|
export { RadioIcon } from './RadioIcon';
|
|
4
|
+
export { RadioCard } from './RadioCard/RadioCard';
|
|
5
|
+
export { useRadioCardContext } from './RadioCard/RadioCard.context';
|
|
6
|
+
export { RadioIndicator } from './RadioIndicator/RadioIndicator';
|
|
4
7
|
export type { RadioIconProps } from './RadioIcon';
|
|
8
|
+
export type { RadioCardContextValue } from './RadioCard/RadioCard.context';
|
|
5
9
|
export type { RadioCssVariables, RadioFactory, RadioProps, RadioStylesNames, RadioVariant, } from './Radio';
|
|
6
10
|
export type { RadioGroupFactory, RadioGroupProps, RadioGroupStylesNames, } from './RadioGroup/RadioGroup';
|
|
11
|
+
export type { RadioCardCssVariables, RadioCardFactory, RadioCardProps, RadioCardStylesNames, } from './RadioCard/RadioCard';
|
|
12
|
+
export type { RadioIndicatorCssVariables, RadioIndicatorFactory, RadioIndicatorProps, RadioIndicatorStylesNames, RadioIndicatorVariant, } from './RadioIndicator/RadioIndicator';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BoxProps, ElementProps, Factory, MantineSpacing, StyleProp, StylesApiProps } from '../../core';
|
|
2
|
-
export type SimpleGridStylesNames = 'root';
|
|
2
|
+
export type SimpleGridStylesNames = 'root' | 'container';
|
|
3
3
|
export interface SimpleGridProps extends BoxProps, StylesApiProps<SimpleGridFactory>, ElementProps<'div'> {
|
|
4
4
|
/** Number of columns, `1` by default */
|
|
5
5
|
cols?: StyleProp<number>;
|
|
@@ -7,6 +7,8 @@ export interface SimpleGridProps extends BoxProps, StylesApiProps<SimpleGridFact
|
|
|
7
7
|
spacing?: StyleProp<MantineSpacing>;
|
|
8
8
|
/** Spacing between rows, `'md'` by default */
|
|
9
9
|
verticalSpacing?: StyleProp<MantineSpacing>;
|
|
10
|
+
/** Determines typeof of queries that are used for responsive styles, `'media'` by default */
|
|
11
|
+
type?: 'media' | 'container';
|
|
10
12
|
}
|
|
11
13
|
export type SimpleGridFactory = Factory<{
|
|
12
14
|
props: SimpleGridProps;
|
|
@@ -2,5 +2,6 @@ import type { SimpleGridProps } from './SimpleGrid';
|
|
|
2
2
|
interface SimpleGridVariablesProps extends SimpleGridProps {
|
|
3
3
|
selector: string;
|
|
4
4
|
}
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function SimpleGridMediaVariables({ spacing, verticalSpacing, cols, selector, }: SimpleGridVariablesProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function SimpleGridContainerVariables({ spacing, verticalSpacing, cols, selector, }: SimpleGridVariablesProps): import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
export {};
|
|
@@ -6,21 +6,28 @@ export interface TreeNodeData {
|
|
|
6
6
|
nodeProps?: Record<string, any>;
|
|
7
7
|
children?: TreeNodeData[];
|
|
8
8
|
}
|
|
9
|
-
export interface
|
|
9
|
+
export interface RenderTreeNodePayload {
|
|
10
|
+
/** Node level in the tree */
|
|
10
11
|
level: number;
|
|
12
|
+
/** `true` if the node is expanded, applicable only for nodes with `children` */
|
|
11
13
|
expanded: boolean;
|
|
14
|
+
/** `true` if the node has non-empty `children` array */
|
|
12
15
|
hasChildren: boolean;
|
|
16
|
+
/** `true` if the node is selected */
|
|
13
17
|
selected: boolean;
|
|
18
|
+
/** Node data from the `data` prop of `Tree` */
|
|
14
19
|
node: TreeNodeData;
|
|
20
|
+
/** Props to spread into the root node element */
|
|
15
21
|
elementProps: {
|
|
16
22
|
className: string;
|
|
17
23
|
style: React.CSSProperties;
|
|
18
24
|
onClick: (event: React.MouseEvent) => void;
|
|
19
25
|
'data-selected': boolean | undefined;
|
|
20
26
|
'data-value': string;
|
|
27
|
+
'data-hovered': boolean | undefined;
|
|
21
28
|
};
|
|
22
29
|
}
|
|
23
|
-
export type RenderNode = (payload:
|
|
30
|
+
export type RenderNode = (payload: RenderTreeNodePayload) => React.ReactNode;
|
|
24
31
|
export type TreeStylesNames = 'root' | 'node' | 'subtree' | 'label';
|
|
25
32
|
export type TreeCssVariables = {
|
|
26
33
|
root: '--level-offset';
|
|
@@ -32,6 +39,8 @@ export interface TreeProps extends BoxProps, StylesApiProps<TreeFactory>, Elemen
|
|
|
32
39
|
levelOffset?: MantineSpacing;
|
|
33
40
|
/** Determines whether tree node with children should be expanded on click, `true` by default */
|
|
34
41
|
expandOnClick?: boolean;
|
|
42
|
+
/** Determines whether tree node with children should be expanded on space key press, `true` by default */
|
|
43
|
+
expandOnSpace?: boolean;
|
|
35
44
|
/** Determines whether node should be selected on click, `false` by default */
|
|
36
45
|
selectOnClick?: boolean;
|
|
37
46
|
/** use-tree hook instance that can be used to manipulate component state */
|
|
@@ -13,8 +13,9 @@ interface TreeNodeProps {
|
|
|
13
13
|
renderNode: RenderNode | undefined;
|
|
14
14
|
selectOnClick: boolean | undefined;
|
|
15
15
|
allowRangeSelection: boolean | undefined;
|
|
16
|
+
expandOnSpace: boolean | undefined;
|
|
16
17
|
}
|
|
17
|
-
export declare function TreeNode({ node, getStyles, rootIndex, controller, expandOnClick, selectOnClick, isSubtree, level, renderNode, flatValues, allowRangeSelection, }: TreeNodeProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function TreeNode({ node, getStyles, rootIndex, controller, expandOnClick, selectOnClick, isSubtree, level, renderNode, flatValues, allowRangeSelection, expandOnSpace, }: TreeNodeProps): import("react/jsx-runtime").JSX.Element;
|
|
18
19
|
export declare namespace TreeNode {
|
|
19
20
|
var displayName: string;
|
|
20
21
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { Tree } from './Tree';
|
|
2
2
|
export { useTree } from './use-tree';
|
|
3
|
-
export type { TreeCssVariables, TreeFactory, TreeProps, TreeStylesNames, TreeNodeData, } from './Tree';
|
|
4
|
-
export type { UseTreeInput } from './use-tree';
|
|
3
|
+
export type { TreeCssVariables, TreeFactory, TreeProps, TreeStylesNames, TreeNodeData, RenderTreeNodePayload, } from './Tree';
|
|
4
|
+
export type { UseTreeInput, UseTreeReturnType } from './use-tree';
|
|
@@ -1,26 +1,52 @@
|
|
|
1
1
|
import type { TreeNodeData } from './Tree';
|
|
2
2
|
export type TreeExpandedState = Record<string, boolean>;
|
|
3
3
|
export interface UseTreeInput {
|
|
4
|
+
/** Initial expanded state of all nodes */
|
|
4
5
|
initialExpandedState?: TreeExpandedState;
|
|
6
|
+
/** Initial selected state of nodes */
|
|
5
7
|
initialSelectedState?: string[];
|
|
8
|
+
/** Determines whether multiple node can be selected at a time */
|
|
6
9
|
multiple?: boolean;
|
|
7
10
|
}
|
|
8
|
-
export
|
|
11
|
+
export interface UseTreeReturnType {
|
|
12
|
+
/** Determines whether multiple node can be selected at a time */
|
|
9
13
|
multiple: boolean;
|
|
14
|
+
/** A record of `node.value` and boolean values that represent nodes expanded state */
|
|
10
15
|
expandedState: TreeExpandedState;
|
|
16
|
+
/** An array of selected nodes values */
|
|
11
17
|
selectedState: string[];
|
|
18
|
+
/** A value of the node that was last clicked
|
|
19
|
+
* Anchor node is used to determine range of selected nodes for multiple selection
|
|
20
|
+
*/
|
|
12
21
|
anchorNode: string | null;
|
|
22
|
+
/** Initializes tree state based on provided data, called automatically by the Tree component */
|
|
13
23
|
initialize: (data: TreeNodeData[]) => void;
|
|
24
|
+
/** Toggles expanded state of the node with provided value */
|
|
14
25
|
toggleExpanded: (value: string) => void;
|
|
26
|
+
/** Collapses node with provided value */
|
|
15
27
|
collapse: (value: string) => void;
|
|
28
|
+
/** Expands node with provided value */
|
|
16
29
|
expand: (value: string) => void;
|
|
30
|
+
/** Expands all nodes */
|
|
17
31
|
expandAllNodes: () => void;
|
|
32
|
+
/** Collapses all nodes */
|
|
18
33
|
collapseAllNodes: () => void;
|
|
19
|
-
|
|
34
|
+
/** Sets expanded state */
|
|
35
|
+
setExpandedState: React.Dispatch<React.SetStateAction<TreeExpandedState>>;
|
|
36
|
+
/** Toggles selected state of the node with provided value */
|
|
20
37
|
toggleSelected: (value: string) => void;
|
|
38
|
+
/** Selects node with provided value */
|
|
21
39
|
select: (value: string) => void;
|
|
40
|
+
/** Deselects node with provided value */
|
|
22
41
|
deselect: (value: string) => void;
|
|
42
|
+
/** Clears selected state */
|
|
23
43
|
clearSelected: () => void;
|
|
24
|
-
|
|
25
|
-
|
|
44
|
+
/** Sets selected state */
|
|
45
|
+
setSelectedState: React.Dispatch<React.SetStateAction<string[]>>;
|
|
46
|
+
/** A value of the node that is currently hovered */
|
|
47
|
+
hoveredNode: string | null;
|
|
48
|
+
/** Sets hovered node */
|
|
49
|
+
setHoveredNode: React.Dispatch<React.SetStateAction<string | null>>;
|
|
50
|
+
}
|
|
51
|
+
export declare function useTree({ initialSelectedState, initialExpandedState, multiple, }?: UseTreeInput): UseTreeReturnType;
|
|
26
52
|
export type TreeController = ReturnType<typeof useTree>;
|
package/lib/core/Box/Box.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export interface BoxProps extends MantineStyleProps {
|
|
|
10
10
|
style?: MantineStyleProp;
|
|
11
11
|
/** CSS variables defined on root component element */
|
|
12
12
|
__vars?: CssVarsProp;
|
|
13
|
+
/** `size` property passed down the HTML element */
|
|
14
|
+
__size?: string;
|
|
13
15
|
/** Breakpoint above which the component is hidden with `display: none` */
|
|
14
16
|
hiddenFrom?: MantineBreakpoint;
|
|
15
17
|
/** Breakpoint below which the component is hidden with `display: none` */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { borderResolver } from './border-resolver/border-resolver';
|
|
1
2
|
import { colorResolver, textColorResolver } from './color-resolver/color-resolver';
|
|
2
3
|
import { fontFamilyResolver } from './font-family-resolver/font-family-resolver';
|
|
3
4
|
import { fontSizeResolver } from './font-size-resolver/font-size-resolver';
|
|
@@ -14,5 +15,6 @@ export declare const resolvers: {
|
|
|
14
15
|
size: typeof sizeResolver;
|
|
15
16
|
lineHeight: typeof lineHeightResolver;
|
|
16
17
|
fontFamily: typeof fontFamilyResolver;
|
|
18
|
+
border: typeof borderResolver;
|
|
17
19
|
};
|
|
18
20
|
export type StylePropType = keyof typeof resolvers;
|
|
@@ -19,6 +19,7 @@ export interface MantineStyleProps {
|
|
|
19
19
|
pe?: StyleProp<MantineSpacing>;
|
|
20
20
|
pl?: StyleProp<MantineSpacing>;
|
|
21
21
|
pr?: StyleProp<MantineSpacing>;
|
|
22
|
+
bd?: StyleProp<React.CSSProperties['border']>;
|
|
22
23
|
bg?: StyleProp<MantineColor>;
|
|
23
24
|
c?: StyleProp<MantineColor>;
|
|
24
25
|
opacity?: StyleProp<React.CSSProperties['opacity']>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { InlineStylesInput } from './styles-to-string/styles-to-string';
|
|
2
2
|
export interface InlineStylesProps extends InlineStylesInput, Omit<React.ComponentPropsWithoutRef<'style'>, keyof InlineStylesInput> {
|
|
3
3
|
}
|
|
4
|
-
export declare function InlineStyles(
|
|
4
|
+
export declare function InlineStyles(props: InlineStylesInput): import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,5 +6,6 @@ export interface InlineStylesInput {
|
|
|
6
6
|
selector: string;
|
|
7
7
|
styles?: React.CSSProperties;
|
|
8
8
|
media?: InlineStylesMediaQuery[];
|
|
9
|
+
container?: InlineStylesMediaQuery[];
|
|
9
10
|
}
|
|
10
|
-
export declare function stylesToString({ selector, styles, media }: InlineStylesInput): string;
|
|
11
|
+
export declare function stylesToString({ selector, styles, media, container }: InlineStylesInput): string;
|