@utilitywarehouse/hearth-react-native 0.14.1 → 0.15.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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-lint.log +1 -1
- package/CHANGELOG.md +55 -0
- package/build/components/BottomSheet/index.d.ts +5 -5
- package/build/components/BottomSheet/index.js +4 -4
- package/build/components/Checkbox/Checkbox.d.ts +1 -1
- package/build/components/Checkbox/Checkbox.js +2 -4
- package/build/components/DescriptionList/DescriptionListItem.js +8 -1
- package/build/components/HTMLElements/ListItem.d.ts +9 -1
- package/build/components/HTMLElements/ListItem.js +1 -2
- package/build/components/HTMLElements/OrderedList.d.ts +3 -2
- package/build/components/HTMLElements/OrderedList.js +29 -4
- package/build/components/HTMLElements/UnorderedList.d.ts +3 -2
- package/build/components/HTMLElements/UnorderedList.js +29 -4
- package/build/components/Helper/Helper.js +1 -1
- package/build/components/Helper/HelperText.js +1 -0
- package/build/components/Input/Input.js +2 -2
- package/build/components/Modal/Modal.d.ts +1 -1
- package/build/components/Modal/Modal.js +49 -4
- package/build/components/Modal/Modal.props.d.ts +1 -0
- package/build/components/PillGroup/PillGroup.props.d.ts +19 -7
- package/package.json +1 -1
- package/src/components/BottomSheet/index.ts +7 -5
- package/src/components/Checkbox/Checkbox.tsx +7 -2
- package/src/components/DescriptionList/DescriptionListItem.tsx +8 -1
- package/src/components/HTMLElements/ListItem.tsx +11 -3
- package/src/components/HTMLElements/Lists.docs.mdx +64 -16
- package/src/components/HTMLElements/OrderedList.stories.tsx +33 -2
- package/src/components/HTMLElements/OrderedList.tsx +54 -6
- package/src/components/HTMLElements/UnorderedList.stories.tsx +63 -5
- package/src/components/HTMLElements/UnorderedList.tsx +50 -6
- package/src/components/Helper/Helper.tsx +1 -1
- package/src/components/Helper/HelperText.tsx +1 -0
- package/src/components/Input/Input.tsx +2 -0
- package/src/components/Modal/Modal.props.ts +1 -0
- package/src/components/Modal/Modal.tsx +86 -23
- package/src/components/PillGroup/PillGroup.props.ts +25 -11
- package/src/components/PillGroup/PillGroup.stories.tsx +5 -6
- package/src/components/PillGroup/PillGroup.tsx +3 -3
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
1
|
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
2
|
import { HeartMediumIcon } from '@utilitywarehouse/hearth-react-native-icons';
|
|
3
|
+
import { useState } from 'react';
|
|
4
4
|
import { PillGroup } from '.';
|
|
5
|
-
import { Pill } from './Pill';
|
|
6
5
|
import { VariantTitle } from '../../../docs/components';
|
|
7
6
|
import { BodyText } from '../BodyText';
|
|
8
7
|
import { Flex } from '../Flex';
|
|
9
|
-
import {
|
|
8
|
+
import { Pill } from './Pill';
|
|
10
9
|
|
|
11
10
|
const meta = {
|
|
12
11
|
title: 'Stories / PillGroup',
|
|
@@ -104,7 +103,7 @@ export const WrapBehavior: Story = {
|
|
|
104
103
|
return (
|
|
105
104
|
<Flex space="xl" direction="column" align="center">
|
|
106
105
|
<VariantTitle title="Wrap: False">
|
|
107
|
-
<PillGroup wrap={false} value={value1} onChange={
|
|
106
|
+
<PillGroup wrap={false} value={value1} onChange={setValue1}>
|
|
108
107
|
<Pill value="1" label="New" />
|
|
109
108
|
<Pill value="2" label="Some label" />
|
|
110
109
|
<Pill value="3" label="Short" />
|
|
@@ -113,7 +112,7 @@ export const WrapBehavior: Story = {
|
|
|
113
112
|
</PillGroup>
|
|
114
113
|
</VariantTitle>
|
|
115
114
|
<VariantTitle title="Wrap: True">
|
|
116
|
-
<PillGroup wrap={true} value={value2} onChange={
|
|
115
|
+
<PillGroup wrap={true} value={value2} onChange={setValue2}>
|
|
117
116
|
<Pill value="6" label="New" />
|
|
118
117
|
<Pill value="7" label="Some label" />
|
|
119
118
|
<Pill value="8" label="Short" />
|
|
@@ -141,7 +140,7 @@ export const Multiple: Story = {
|
|
|
141
140
|
|
|
142
141
|
return (
|
|
143
142
|
<Flex space="lg" direction="column" align="center" style={{ maxWidth: 400 }}>
|
|
144
|
-
<PillGroup wrap={true} multiple value={selectedCategories} onChange={
|
|
143
|
+
<PillGroup wrap={true} multiple value={selectedCategories} onChange={setSelectedCategories}>
|
|
145
144
|
<Pill value="unread" label="Unread" />
|
|
146
145
|
<Pill value="new" label="New" icon={HeartMediumIcon} />
|
|
147
146
|
<Pill value="favourites" label="My favourites" icon={HeartMediumIcon} />
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
2
|
import { ScrollView } from 'react-native';
|
|
3
3
|
import { StyleSheet } from 'react-native-unistyles';
|
|
4
4
|
import { Box } from '../Box';
|
|
@@ -24,9 +24,9 @@ export const PillGroup = ({
|
|
|
24
24
|
const newValue = normalizedValue.includes(pillValue)
|
|
25
25
|
? normalizedValue.filter(v => v !== pillValue)
|
|
26
26
|
: [...normalizedValue, pillValue];
|
|
27
|
-
onChange?.(newValue);
|
|
27
|
+
(onChange as (value: string[]) => void)?.(newValue);
|
|
28
28
|
} else {
|
|
29
|
-
onChange?.(pillValue);
|
|
29
|
+
(onChange as (value: string) => void)?.(pillValue);
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
}),
|