Skip to content

Commit c9afe84

Browse files
committed
feat: re-export spectrum useStyleProps
useStyleProps takes the common spectrum style props and resolves them to values. In my case I need the resolved version of a dimensionValue ("size-100") as var(--XXX), and things like paddingY resolved as paddingTop, paddingBottom.
1 parent 1803f31 commit c9afe84

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

package-lock.json

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/components/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"@fortawesome/fontawesome-svg-core": "^6.2.1",
3333
"@fortawesome/react-fontawesome": "^0.2.0",
3434
"@react-spectrum/theme-default": "^3.5.1",
35+
"@react-spectrum/utils": "^3.11.5",
3536
"@react-types/shared": "^3.22.1",
3637
"@react-types/textfield": "^3.9.1",
3738
"bootstrap": "4.6.2",

packages/components/src/spectrum/utils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import { theme } from '@react-spectrum/theme-default';
22
import { themeSpectrumClassesCommon } from '../theme/theme-spectrum';
33

4+
export {
5+
useStyleProps,
6+
baseStyleProps,
7+
viewStyleProps,
8+
} from '@react-spectrum/utils';
9+
410
const { global, light, dark, medium, large } = theme;
511

612
/**

0 commit comments

Comments
 (0)