@pickle-ui/react-native 0.0.0-stage → 0.0.0
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/README.md +92 -2
- package/dist/components/Badge.d.ts +11 -0
- package/dist/components/Badge.d.ts.map +1 -0
- package/dist/components/Badge.js +33 -0
- package/dist/components/Badge.js.map +1 -0
- package/dist/components/Button.d.ts +13 -0
- package/dist/components/Button.d.ts.map +1 -0
- package/dist/components/Button.js +39 -0
- package/dist/components/Button.js.map +1 -0
- package/dist/components/Card.d.ts +20 -0
- package/dist/components/Card.d.ts.map +1 -0
- package/dist/components/Card.js +29 -0
- package/dist/components/Card.js.map +1 -0
- package/dist/components/Text.d.ts +10 -0
- package/dist/components/Text.d.ts.map +1 -0
- package/dist/components/Text.js +28 -0
- package/dist/components/Text.js.map +1 -0
- package/dist/entries/badge.d.ts +3 -0
- package/dist/entries/badge.d.ts.map +1 -0
- package/dist/entries/badge.js +2 -0
- package/dist/entries/badge.js.map +1 -0
- package/dist/entries/button.d.ts +3 -0
- package/dist/entries/button.d.ts.map +1 -0
- package/dist/entries/button.js +2 -0
- package/dist/entries/button.js.map +1 -0
- package/dist/entries/card.d.ts +3 -0
- package/dist/entries/card.d.ts.map +1 -0
- package/dist/entries/card.js +2 -0
- package/dist/entries/card.js.map +1 -0
- package/dist/entries/cn.d.ts +2 -0
- package/dist/entries/cn.d.ts.map +1 -0
- package/dist/entries/cn.js +2 -0
- package/dist/entries/cn.js.map +1 -0
- package/dist/entries/text.d.ts +3 -0
- package/dist/entries/text.d.ts.map +1 -0
- package/dist/entries/text.js +2 -0
- package/dist/entries/text.js.map +1 -0
- package/dist/entries/use-color-token.d.ts +2 -0
- package/dist/entries/use-color-token.d.ts.map +1 -0
- package/dist/entries/use-color-token.js +2 -0
- package/dist/entries/use-color-token.js.map +1 -0
- package/dist/hooks/useColorToken.d.ts +9 -0
- package/dist/hooks/useColorToken.d.ts.map +1 -0
- package/dist/hooks/useColorToken.js +13 -0
- package/dist/hooks/useColorToken.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/cn.d.ts +3 -0
- package/dist/lib/cn.d.ts.map +1 -0
- package/dist/lib/cn.js +6 -0
- package/dist/lib/cn.js.map +1 -0
- package/package.json +91 -3
- package/src/base.css +6 -0
- package/src/components/Badge.stories.tsx +47 -0
- package/src/components/Badge.test.tsx +11 -0
- package/src/components/Badge.tsx +42 -0
- package/src/components/Button.stories.tsx +87 -0
- package/src/components/Button.test.tsx +34 -0
- package/src/components/Button.tsx +70 -0
- package/src/components/Card.stories.tsx +55 -0
- package/src/components/Card.test.tsx +23 -0
- package/src/components/Card.tsx +55 -0
- package/src/components/Text.stories.tsx +60 -0
- package/src/components/Text.test.tsx +15 -0
- package/src/components/Text.tsx +37 -0
- package/src/components/_internal/Story.tsx +148 -0
- package/src/entries/badge.ts +2 -0
- package/src/entries/button.ts +2 -0
- package/src/entries/card.ts +8 -0
- package/src/entries/cn.ts +1 -0
- package/src/entries/text.ts +2 -0
- package/src/entries/use-color-token.ts +1 -0
- package/src/hooks/useColorToken.ts +13 -0
- package/src/index.ts +8 -0
- package/src/lib/cn.test.ts +9 -0
- package/src/lib/cn.ts +6 -0
- package/src/styles.css +12 -0
- package/src/uniwind-types.d.ts +10 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { cn } from '../lib/cn';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useColorToken } from '../hooks/useColorToken';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useCSSVariable } from 'uniwind';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Reads a token as a color string, for props that take a color instead of a
|
|
5
|
+
* className (navigation options, `Switch`, `placeholderTextColor`).
|
|
6
|
+
* `useColorToken('primary')` returns the value behind `bg-primary`, or
|
|
7
|
+
* `undefined` when the token doesn't exist, so a typo never turns into the
|
|
8
|
+
* color `"undefined"`.
|
|
9
|
+
*/
|
|
10
|
+
export function useColorToken(name: string): string | undefined {
|
|
11
|
+
const value = useCSSVariable(`--${name}`);
|
|
12
|
+
return typeof value === 'string' ? value : undefined;
|
|
13
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// The public API is the union of the subpath entries in ./entries: add a
|
|
2
|
+
// component there and re-export it here (see "Public API" in AGENTS.md).
|
|
3
|
+
export * from './entries/badge';
|
|
4
|
+
export * from './entries/button';
|
|
5
|
+
export * from './entries/card';
|
|
6
|
+
export * from './entries/cn';
|
|
7
|
+
export * from './entries/text';
|
|
8
|
+
export * from './entries/use-color-token';
|
package/src/lib/cn.ts
ADDED
package/src/styles.css
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pickle for React Native: Tailwind, Uniwind, the tokens as Uniwind themes
|
|
3
|
+
* and the components' classes. Apps import this file alone.
|
|
4
|
+
*
|
|
5
|
+
* Tailwind and Uniwind come from here, not from the app: Uniwind compiles
|
|
6
|
+
* each imported stylesheet on its own to find themes, and the tokens'
|
|
7
|
+
* `@variant light` / `@variant dark` blocks only compile after both.
|
|
8
|
+
*/
|
|
9
|
+
@import 'tailwindcss';
|
|
10
|
+
@import 'uniwind';
|
|
11
|
+
@import '@pickle-ui/tokens/native.css';
|
|
12
|
+
@import './base.css';
|