@dxos/react-ui-pickers 0.8.4-main.e8ec1fe → 0.8.4-main.ef1bc66f44
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/dist/lib/browser/chunk-IEOELSPW.mjs +64 -0
- package/dist/lib/browser/chunk-IEOELSPW.mjs.map +7 -0
- package/dist/lib/browser/components/IconPicker/icons.mjs +9 -0
- package/dist/lib/browser/components/IconPicker/icons.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +192 -284
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/chunk-OLGXN23I.mjs +66 -0
- package/dist/lib/node-esm/chunk-OLGXN23I.mjs.map +7 -0
- package/dist/lib/node-esm/components/IconPicker/icons.mjs +10 -0
- package/dist/lib/node-esm/components/IconPicker/icons.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +191 -284
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
- package/dist/types/src/components/HuePicker/HuePicker.stories.d.ts +1 -1
- package/dist/types/src/components/IconPicker/IconPicker.d.ts +0 -6
- package/dist/types/src/components/IconPicker/IconPicker.d.ts.map +1 -1
- package/dist/types/src/components/IconPicker/IconPicker.stories.d.ts +1 -1
- package/dist/types/src/components/IconPicker/icons.d.ts +7 -0
- package/dist/types/src/components/IconPicker/icons.d.ts.map +1 -0
- package/dist/types/src/components/PickerButton/PickerButton.d.ts +1 -1
- package/dist/types/src/components/PickerButton/PickerButton.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +30 -17
- package/src/components/EmojiPicker/EmojiPicker.stories.tsx +1 -1
- package/src/components/EmojiPicker/EmojiPicker.tsx +3 -2
- package/src/components/HuePicker/HuePicker.stories.tsx +1 -1
- package/src/components/HuePicker/HuePicker.tsx +2 -2
- package/src/components/IconPicker/IconPicker.stories.tsx +1 -1
- package/src/components/IconPicker/IconPicker.tsx +4 -64
- package/src/components/IconPicker/icons.ts +66 -0
- package/src/components/PickerButton/PickerButton.tsx +5 -5
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-pickers",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.ef1bc66f44",
|
|
4
4
|
"description": "A collection of picker components.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/dxos/dxos"
|
|
10
|
+
},
|
|
7
11
|
"license": "MIT",
|
|
8
12
|
"author": "DXOS.org",
|
|
9
13
|
"type": "module",
|
|
@@ -13,11 +17,21 @@
|
|
|
13
17
|
"types": "./dist/types/src/index.d.ts",
|
|
14
18
|
"browser": "./dist/lib/browser/index.mjs",
|
|
15
19
|
"node": "./dist/lib/node-esm/index.mjs"
|
|
20
|
+
},
|
|
21
|
+
"./icons": {
|
|
22
|
+
"source": "./src/components/IconPicker/icons.ts",
|
|
23
|
+
"types": "./dist/types/src/components/IconPicker/icons.d.ts",
|
|
24
|
+
"browser": "./dist/lib/browser/components/IconPicker/icons.mjs",
|
|
25
|
+
"node": "./dist/lib/node-esm/components/IconPicker/icons.mjs"
|
|
16
26
|
}
|
|
17
27
|
},
|
|
18
28
|
"types": "dist/types/src/index.d.ts",
|
|
19
29
|
"typesVersions": {
|
|
20
|
-
"*": {
|
|
30
|
+
"*": {
|
|
31
|
+
"icons": [
|
|
32
|
+
"./dist/types/src/components/IconPicker/icons.d.ts"
|
|
33
|
+
]
|
|
34
|
+
}
|
|
21
35
|
},
|
|
22
36
|
"files": [
|
|
23
37
|
"dist",
|
|
@@ -26,28 +40,27 @@
|
|
|
26
40
|
"dependencies": {
|
|
27
41
|
"@emoji-mart/data": "^1.1.2",
|
|
28
42
|
"@emoji-mart/react": "^1.1.1",
|
|
29
|
-
"@preact-signals/safe-react": "^0.9.0",
|
|
30
43
|
"@radix-ui/react-use-controllable-state": "1.1.0",
|
|
31
44
|
"react-resize-detector": "^11.0.1",
|
|
32
|
-
"@dxos/log": "0.8.4-main.
|
|
33
|
-
"@dxos/
|
|
34
|
-
"@dxos/util": "0.8.4-main.
|
|
45
|
+
"@dxos/log": "0.8.4-main.ef1bc66f44",
|
|
46
|
+
"@dxos/ui-types": "0.8.4-main.ef1bc66f44",
|
|
47
|
+
"@dxos/util": "0.8.4-main.ef1bc66f44"
|
|
35
48
|
},
|
|
36
49
|
"devDependencies": {
|
|
37
|
-
"@types/react": "~19.2.
|
|
38
|
-
"@types/react-dom": "~19.2.
|
|
39
|
-
"react": "~19.2.
|
|
40
|
-
"react-dom": "~19.2.
|
|
50
|
+
"@types/react": "~19.2.7",
|
|
51
|
+
"@types/react-dom": "~19.2.3",
|
|
52
|
+
"react": "~19.2.3",
|
|
53
|
+
"react-dom": "~19.2.3",
|
|
41
54
|
"vite": "7.1.9",
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
55
|
+
"@dxos/ui-theme": "0.8.4-main.ef1bc66f44",
|
|
56
|
+
"@dxos/storybook-utils": "0.8.4-main.ef1bc66f44",
|
|
57
|
+
"@dxos/react-ui": "0.8.4-main.ef1bc66f44"
|
|
45
58
|
},
|
|
46
59
|
"peerDependencies": {
|
|
47
|
-
"react": "
|
|
48
|
-
"react-dom": "
|
|
49
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
50
|
-
"@dxos/
|
|
60
|
+
"react": "~19.2.3",
|
|
61
|
+
"react-dom": "~19.2.3",
|
|
62
|
+
"@dxos/react-ui": "0.8.4-main.ef1bc66f44",
|
|
63
|
+
"@dxos/ui-theme": "0.8.4-main.ef1bc66f44"
|
|
51
64
|
},
|
|
52
65
|
"publishConfig": {
|
|
53
66
|
"access": "public"
|
|
@@ -14,7 +14,7 @@ import { EmojiPickerBlock, type EmojiPickerProps, EmojiPickerToolbarButton } fro
|
|
|
14
14
|
const meta = {
|
|
15
15
|
title: 'ui/react-ui-pickers/EmojiPicker',
|
|
16
16
|
component: EmojiPicker,
|
|
17
|
-
decorators: [withTheme, withLayout({
|
|
17
|
+
decorators: [withTheme(), withLayout({ layout: 'column' })],
|
|
18
18
|
} satisfies Meta<typeof EmojiPicker>;
|
|
19
19
|
|
|
20
20
|
export default meta;
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
useThemeContext,
|
|
21
21
|
useTranslation,
|
|
22
22
|
} from '@dxos/react-ui';
|
|
23
|
+
import { osTranslations } from '@dxos/ui-theme';
|
|
23
24
|
|
|
24
25
|
import './emoji.css';
|
|
25
26
|
|
|
@@ -42,7 +43,7 @@ export const EmojiPickerToolbarButton = ({
|
|
|
42
43
|
defaultEmoji,
|
|
43
44
|
onChangeEmoji,
|
|
44
45
|
}: Omit<EmojiPickerProps, 'onClickClear'>) => {
|
|
45
|
-
const { t } = useTranslation(
|
|
46
|
+
const { t } = useTranslation(osTranslations);
|
|
46
47
|
const { themeMode } = useThemeContext();
|
|
47
48
|
|
|
48
49
|
const [_emojiValue, setEmojiValue] = useControllableState<string>({
|
|
@@ -112,7 +113,7 @@ export const EmojiPickerBlock = ({
|
|
|
112
113
|
triggerVariant = 'ghost',
|
|
113
114
|
classNames,
|
|
114
115
|
}: EmojiPickerProps) => {
|
|
115
|
-
const { t } = useTranslation(
|
|
116
|
+
const { t } = useTranslation(osTranslations);
|
|
116
117
|
const [isMd] = useMediaQuery('md');
|
|
117
118
|
|
|
118
119
|
const [emojiValue, setEmojiValue] = useControllableState<string>({
|
|
@@ -30,7 +30,7 @@ const meta = {
|
|
|
30
30
|
title: 'ui/react-ui-pickers/HuePicker',
|
|
31
31
|
component: HuePicker,
|
|
32
32
|
render: DefaultStory,
|
|
33
|
-
decorators: [withTheme, withLayout({
|
|
33
|
+
decorators: [withTheme(), withLayout({ layout: 'column' })],
|
|
34
34
|
} satisfies Meta<typeof HuePicker>;
|
|
35
35
|
|
|
36
36
|
export default meta;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { type ButtonProps, type IconProps, type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
8
|
-
import { getSize, hues } from '@dxos/
|
|
8
|
+
import { getSize, hues, osTranslations } from '@dxos/ui-theme';
|
|
9
9
|
|
|
10
10
|
import { PickerButton, type PickerButtonProps } from '../PickerButton';
|
|
11
11
|
|
|
@@ -18,7 +18,7 @@ export type HuePickerProps = {
|
|
|
18
18
|
} & Pick<PickerButtonProps, 'disabled' | 'defaultValue' | 'value' | 'onChange' | 'onReset' | 'rootVariant'>;
|
|
19
19
|
|
|
20
20
|
export const HuePicker = (props: ThemedClassName<HuePickerProps>) => {
|
|
21
|
-
const { t } = useTranslation(
|
|
21
|
+
const { t } = useTranslation(osTranslations);
|
|
22
22
|
|
|
23
23
|
return (
|
|
24
24
|
<PickerButton
|
|
@@ -25,7 +25,7 @@ const meta = {
|
|
|
25
25
|
title: 'ui/react-ui-pickers/IconPicker',
|
|
26
26
|
component: IconPicker,
|
|
27
27
|
render: DefaultStory,
|
|
28
|
-
decorators: [withTheme, withLayout({
|
|
28
|
+
decorators: [withTheme(), withLayout({ layout: 'column' })],
|
|
29
29
|
} satisfies Meta<typeof IconPicker>;
|
|
30
30
|
|
|
31
31
|
export default meta;
|
|
@@ -5,9 +5,12 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { type ButtonProps, Icon, type IconProps, type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
8
|
+
import { osTranslations } from '@dxos/ui-theme';
|
|
8
9
|
|
|
9
10
|
import { PickerButton, type PickerButtonProps } from '../PickerButton';
|
|
10
11
|
|
|
12
|
+
import { iconValues } from './icons';
|
|
13
|
+
|
|
11
14
|
export type IconPickerProps = {
|
|
12
15
|
disabled?: boolean;
|
|
13
16
|
defaultValue?: string;
|
|
@@ -20,7 +23,7 @@ export type IconPickerProps = {
|
|
|
20
23
|
>;
|
|
21
24
|
|
|
22
25
|
export const IconPicker = ({ ...props }: ThemedClassName<IconPickerProps>) => {
|
|
23
|
-
const { t } = useTranslation(
|
|
26
|
+
const { t } = useTranslation(osTranslations);
|
|
24
27
|
|
|
25
28
|
return (
|
|
26
29
|
<PickerButton
|
|
@@ -36,66 +39,3 @@ export const IconPicker = ({ ...props }: ThemedClassName<IconPickerProps>) => {
|
|
|
36
39
|
const IconPreview = ({ value, size }: { value: string; size?: IconProps['size'] }) => {
|
|
37
40
|
return <Icon icon={`ph--${value}--regular`} size={size} />;
|
|
38
41
|
};
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* https://phosphoricons.com
|
|
42
|
-
* NOTE: Select icons that we are unlikely to use for the UI.
|
|
43
|
-
*/
|
|
44
|
-
export const icons = [
|
|
45
|
-
'ph--house-line--regular',
|
|
46
|
-
'ph--planet--regular',
|
|
47
|
-
'ph--castle-turret--regular',
|
|
48
|
-
'ph--snowflake--regular',
|
|
49
|
-
'ph--virus--regular',
|
|
50
|
-
'ph--graph--regular',
|
|
51
|
-
'ph--air-traffic-control--regular',
|
|
52
|
-
'ph--asterisk--regular',
|
|
53
|
-
'ph--atom--regular',
|
|
54
|
-
'ph--basketball--regular',
|
|
55
|
-
'ph--butterfly--regular',
|
|
56
|
-
'ph--cactus--regular',
|
|
57
|
-
'ph--cake--regular',
|
|
58
|
-
'ph--calendar-dots--regular',
|
|
59
|
-
'ph--campfire--regular',
|
|
60
|
-
'ph--command--regular',
|
|
61
|
-
'ph--confetti--regular',
|
|
62
|
-
'ph--detective--regular',
|
|
63
|
-
'ph--disco-ball--regular',
|
|
64
|
-
'ph--dna--regular',
|
|
65
|
-
'ph--factory--regular',
|
|
66
|
-
'ph--flag-banner-fold--regular',
|
|
67
|
-
'ph--flask--regular',
|
|
68
|
-
'ph--flower-lotus--regular',
|
|
69
|
-
'ph--flying-saucer--regular',
|
|
70
|
-
'ph--game-controller--regular',
|
|
71
|
-
'ph--gavel--regular',
|
|
72
|
-
'ph--gift--regular',
|
|
73
|
-
'ph--guitar--regular',
|
|
74
|
-
'ph--hamburger--regular',
|
|
75
|
-
'ph--handshake--regular',
|
|
76
|
-
'ph--heart--regular',
|
|
77
|
-
'ph--lightbulb--regular',
|
|
78
|
-
'ph--lock--regular',
|
|
79
|
-
'ph--martini--regular',
|
|
80
|
-
'ph--medal-military--regular',
|
|
81
|
-
'ph--moped-front--regular',
|
|
82
|
-
'ph--office-chair--regular',
|
|
83
|
-
'ph--paint-brush-household--regular',
|
|
84
|
-
'ph--peace--regular',
|
|
85
|
-
'ph--person-simple-hike--regular',
|
|
86
|
-
'ph--piggy-bank--regular',
|
|
87
|
-
'ph--potted-plant--regular',
|
|
88
|
-
'ph--radioactive--regular',
|
|
89
|
-
'ph--rocket-launch--regular',
|
|
90
|
-
'ph--shield-star--regular',
|
|
91
|
-
'ph--shopping-cart--regular',
|
|
92
|
-
'ph--stethoscope--regular',
|
|
93
|
-
'ph--student--regular',
|
|
94
|
-
'ph--sun--regular',
|
|
95
|
-
'ph--tote--regular',
|
|
96
|
-
'ph--tree--regular',
|
|
97
|
-
'ph--users-three--regular',
|
|
98
|
-
'ph--yin-yang--regular',
|
|
99
|
-
];
|
|
100
|
-
|
|
101
|
-
export const iconValues = icons.map((icon) => icon.match(/ph--(.+)--regular/)?.[1] ?? icon);
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* https://phosphoricons.com
|
|
7
|
+
* NOTE: Select icons that we are unlikely to use for the UI.
|
|
8
|
+
*/
|
|
9
|
+
export const icons = [
|
|
10
|
+
'ph--house-line--regular',
|
|
11
|
+
'ph--planet--regular',
|
|
12
|
+
'ph--castle-turret--regular',
|
|
13
|
+
'ph--snowflake--regular',
|
|
14
|
+
'ph--virus--regular',
|
|
15
|
+
'ph--graph--regular',
|
|
16
|
+
'ph--air-traffic-control--regular',
|
|
17
|
+
'ph--asterisk--regular',
|
|
18
|
+
'ph--atom--regular',
|
|
19
|
+
'ph--basketball--regular',
|
|
20
|
+
'ph--butterfly--regular',
|
|
21
|
+
'ph--cactus--regular',
|
|
22
|
+
'ph--cake--regular',
|
|
23
|
+
'ph--calendar-dots--regular',
|
|
24
|
+
'ph--campfire--regular',
|
|
25
|
+
'ph--command--regular',
|
|
26
|
+
'ph--confetti--regular',
|
|
27
|
+
'ph--detective--regular',
|
|
28
|
+
'ph--disco-ball--regular',
|
|
29
|
+
'ph--dna--regular',
|
|
30
|
+
'ph--factory--regular',
|
|
31
|
+
'ph--flag-banner-fold--regular',
|
|
32
|
+
'ph--flask--regular',
|
|
33
|
+
'ph--flower-lotus--regular',
|
|
34
|
+
'ph--flying-saucer--regular',
|
|
35
|
+
'ph--game-controller--regular',
|
|
36
|
+
'ph--gavel--regular',
|
|
37
|
+
'ph--gift--regular',
|
|
38
|
+
'ph--guitar--regular',
|
|
39
|
+
'ph--hamburger--regular',
|
|
40
|
+
'ph--handshake--regular',
|
|
41
|
+
'ph--heart--regular',
|
|
42
|
+
'ph--lightbulb--regular',
|
|
43
|
+
'ph--lock--regular',
|
|
44
|
+
'ph--martini--regular',
|
|
45
|
+
'ph--medal-military--regular',
|
|
46
|
+
'ph--moped-front--regular',
|
|
47
|
+
'ph--office-chair--regular',
|
|
48
|
+
'ph--paint-brush-household--regular',
|
|
49
|
+
'ph--peace--regular',
|
|
50
|
+
'ph--person-simple-hike--regular',
|
|
51
|
+
'ph--piggy-bank--regular',
|
|
52
|
+
'ph--potted-plant--regular',
|
|
53
|
+
'ph--radioactive--regular',
|
|
54
|
+
'ph--rocket-launch--regular',
|
|
55
|
+
'ph--shield-star--regular',
|
|
56
|
+
'ph--shopping-cart--regular',
|
|
57
|
+
'ph--stethoscope--regular',
|
|
58
|
+
'ph--student--regular',
|
|
59
|
+
'ph--sun--regular',
|
|
60
|
+
'ph--tote--regular',
|
|
61
|
+
'ph--tree--regular',
|
|
62
|
+
'ph--users-three--regular',
|
|
63
|
+
'ph--yin-yang--regular',
|
|
64
|
+
];
|
|
65
|
+
|
|
66
|
+
export const iconValues = icons.map((icon) => icon.match(/ph--(.+)--regular/)?.[1] ?? icon);
|
|
@@ -25,8 +25,8 @@ export const PickerButton = ({
|
|
|
25
25
|
Component,
|
|
26
26
|
disabled,
|
|
27
27
|
classNames,
|
|
28
|
-
defaultValue:
|
|
29
|
-
value:
|
|
28
|
+
defaultValue: defaultValueProp,
|
|
29
|
+
value: valueProp,
|
|
30
30
|
values,
|
|
31
31
|
label,
|
|
32
32
|
icon,
|
|
@@ -36,12 +36,12 @@ export const PickerButton = ({
|
|
|
36
36
|
iconSize = 5,
|
|
37
37
|
}: PickerButtonProps) => {
|
|
38
38
|
const [value, setValue] = useControllableState<string>({
|
|
39
|
-
prop:
|
|
40
|
-
defaultProp:
|
|
39
|
+
prop: valueProp,
|
|
40
|
+
defaultProp: defaultValueProp,
|
|
41
41
|
onChange,
|
|
42
42
|
});
|
|
43
43
|
// TODO(burdon): useControllableState doesn't update the prop when the value is changed. Replace it.
|
|
44
|
-
useEffect(() => setValue(
|
|
44
|
+
useEffect(() => setValue(valueProp), [valueProp]);
|
|
45
45
|
|
|
46
46
|
const [open, setOpen] = useState<boolean>(false);
|
|
47
47
|
const TriggerRoot = rootVariant === 'toolbar-button' ? Toolbar.Button : Button;
|