@dxos/react-ui-pickers 0.8.4-main.937b3ca → 0.8.4-main.9be5663bfe
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/index.css +2 -2
- package/dist/lib/browser/index.css.map +2 -2
- package/dist/lib/browser/index.mjs +9 -9
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.css +2 -2
- package/dist/lib/node-esm/index.css.map +2 -2
- package/dist/lib/node-esm/index.mjs +9 -9
- package/dist/lib/node-esm/index.mjs.map +2 -2
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/EmojiPicker/EmojiPicker.d.ts +1 -1
- package/dist/types/src/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
- package/dist/types/src/components/IconPicker/IconPicker.d.ts.map +1 -1
- 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 +10 -10
- package/src/components/EmojiPicker/EmojiPicker.stories.tsx +1 -1
- package/src/components/EmojiPicker/EmojiPicker.tsx +6 -6
- package/src/components/EmojiPicker/emoji.css +5 -21
- 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 +1 -2
- package/src/components/PickerButton/PickerButton.tsx +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-pickers",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.9be5663bfe",
|
|
4
4
|
"description": "A collection of picker components.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -42,25 +42,25 @@
|
|
|
42
42
|
"@emoji-mart/react": "^1.1.1",
|
|
43
43
|
"@radix-ui/react-use-controllable-state": "1.1.0",
|
|
44
44
|
"react-resize-detector": "^11.0.1",
|
|
45
|
-
"@dxos/log": "0.8.4-main.
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
45
|
+
"@dxos/log": "0.8.4-main.9be5663bfe",
|
|
46
|
+
"@dxos/ui-types": "0.8.4-main.9be5663bfe",
|
|
47
|
+
"@dxos/util": "0.8.4-main.9be5663bfe"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/react": "~19.2.7",
|
|
51
51
|
"@types/react-dom": "~19.2.3",
|
|
52
52
|
"react": "~19.2.3",
|
|
53
53
|
"react-dom": "~19.2.3",
|
|
54
|
-
"vite": "7.1.
|
|
55
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
56
|
-
"@dxos/ui
|
|
57
|
-
"@dxos/
|
|
54
|
+
"vite": "^7.1.11",
|
|
55
|
+
"@dxos/storybook-utils": "0.8.4-main.9be5663bfe",
|
|
56
|
+
"@dxos/react-ui": "0.8.4-main.9be5663bfe",
|
|
57
|
+
"@dxos/ui-theme": "0.8.4-main.9be5663bfe"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"react": "~19.2.3",
|
|
61
61
|
"react-dom": "~19.2.3",
|
|
62
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
63
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
62
|
+
"@dxos/react-ui": "0.8.4-main.9be5663bfe",
|
|
63
|
+
"@dxos/ui-theme": "0.8.4-main.9be5663bfe"
|
|
64
64
|
},
|
|
65
65
|
"publishConfig": {
|
|
66
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({ layout: 'column' })],
|
|
17
|
+
decorators: [withTheme(), withLayout({ layout: 'column' })],
|
|
18
18
|
} satisfies Meta<typeof EmojiPicker>;
|
|
19
19
|
|
|
20
20
|
export default meta;
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import './emoji.css';
|
|
6
|
+
|
|
5
7
|
import emojiData from '@emoji-mart/data';
|
|
6
8
|
import EmojiMart from '@emoji-mart/react';
|
|
7
9
|
import { useControllableState } from '@radix-ui/react-use-controllable-state';
|
|
@@ -22,8 +24,6 @@ import {
|
|
|
22
24
|
} from '@dxos/react-ui';
|
|
23
25
|
import { osTranslations } from '@dxos/ui-theme';
|
|
24
26
|
|
|
25
|
-
import './emoji.css';
|
|
26
|
-
|
|
27
27
|
export type EmojiPickerProps = ThemedClassName<{
|
|
28
28
|
disabled?: boolean;
|
|
29
29
|
defaultEmoji?: string;
|
|
@@ -64,7 +64,7 @@ export const EmojiPickerToolbarButton = ({
|
|
|
64
64
|
<Popover.Trigger asChild>
|
|
65
65
|
<Toolbar.IconButton
|
|
66
66
|
icon='ph--user-circle--regular'
|
|
67
|
-
label={t('select
|
|
67
|
+
label={t('select-emoji.label')}
|
|
68
68
|
iconOnly
|
|
69
69
|
tooltipSide='bottom'
|
|
70
70
|
disabled={disabled}
|
|
@@ -128,8 +128,8 @@ export const EmojiPickerBlock = ({
|
|
|
128
128
|
<ButtonGroup classNames={classNames}>
|
|
129
129
|
<Popover.Root open={emojiPickerOpen} onOpenChange={setEmojiPickerOpen}>
|
|
130
130
|
<Popover.Trigger asChild>
|
|
131
|
-
<Button variant={triggerVariant} classNames='grow gap-2 text-2xl
|
|
132
|
-
<span className='sr-only'>{t('select
|
|
131
|
+
<Button variant={triggerVariant} classNames='grow gap-2 text-2xl py-1' disabled={disabled}>
|
|
132
|
+
<span className='sr-only'>{t('select-emoji.label')}</span>
|
|
133
133
|
<span>{emojiValue}</span>
|
|
134
134
|
<Icon icon='ph--caret-down--bold' size={3} />
|
|
135
135
|
</Button>
|
|
@@ -162,7 +162,7 @@ export const EmojiPickerBlock = ({
|
|
|
162
162
|
<IconButton
|
|
163
163
|
icon='ph--arrow-counter-clockwise--regular'
|
|
164
164
|
iconOnly
|
|
165
|
-
label={t('clear
|
|
165
|
+
label={t('clear.label')}
|
|
166
166
|
tooltipSide='right'
|
|
167
167
|
variant={triggerVariant}
|
|
168
168
|
onClick={onClickClear}
|
|
@@ -1,25 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* https://github.com/missive/emoji-mart/blob/main/packages/emoji-mart-website/example-custom-styles.html
|
|
3
3
|
*/
|
|
4
|
-
[data-theme=
|
|
5
|
-
/* TODO(burdon):
|
|
6
|
-
--background-rgb: #
|
|
7
|
-
--rgb-background: #
|
|
8
|
-
|
|
9
|
-
--font-family: "Inter Variable", ui-sans-serif;
|
|
10
|
-
|
|
11
|
-
/*--font-size: 16px;*/
|
|
12
|
-
/*--color-border-over: rgba(0, 0, 0, 0.1);*/
|
|
13
|
-
/*--color-border: rgba(0, 0, 0, 0.05);*/
|
|
14
|
-
/*--category-icon-size: 24px;*/
|
|
15
|
-
/*--border-radius: 24px;*/
|
|
16
|
-
/*--font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;*/
|
|
17
|
-
/*--rgb-accent: 255, 105, 180;*/
|
|
18
|
-
/*--rgb-color: 102, 51, 153;*/
|
|
19
|
-
/*--rgb-input: 255, 235, 235;*/
|
|
20
|
-
/*--shadow: 5px 5px 15px -8px rebeccapurple;*/
|
|
21
|
-
|
|
22
|
-
/*height: 50vh;*/
|
|
23
|
-
/*min-height: 400px;*/
|
|
24
|
-
/*max-height: 800px;*/
|
|
4
|
+
[data-theme='dark'] em-emoji-picker {
|
|
5
|
+
/* TODO(burdon): Use tailwind tokens. */
|
|
6
|
+
--background-rgb: #3b3b3f;
|
|
7
|
+
--rgb-background: #3b3b3f;
|
|
8
|
+
--font-family: 'Inter Variable', ui-sans-serif;
|
|
25
9
|
}
|
|
@@ -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({ layout: 'column' })],
|
|
33
|
+
decorators: [withTheme(), withLayout({ layout: 'column' })],
|
|
34
34
|
} satisfies Meta<typeof HuePicker>;
|
|
35
35
|
|
|
36
36
|
export default meta;
|
|
@@ -23,7 +23,7 @@ export const HuePicker = (props: ThemedClassName<HuePickerProps>) => {
|
|
|
23
23
|
return (
|
|
24
24
|
<PickerButton
|
|
25
25
|
Component={HuePreview}
|
|
26
|
-
label={t('select
|
|
26
|
+
label={t('select-hue.label')}
|
|
27
27
|
icon='ph--palette--regular'
|
|
28
28
|
values={hues}
|
|
29
29
|
{...props}
|
|
@@ -35,7 +35,7 @@ const HuePreview = ({ value, size = 5 }: { value: string; size?: IconProps['size
|
|
|
35
35
|
return (
|
|
36
36
|
<div role='none' className='flex justify-center items-center'>
|
|
37
37
|
<svg viewBox={`0 0 ${size} ${size}`} className={getSize(size)}>
|
|
38
|
-
<rect x={0} y={0} width={size} height={size} fill={`var(--
|
|
38
|
+
<rect x={0} y={0} width={size} height={size} fill={`var(--color-${value}-surface)`} strokeWidth={4} />
|
|
39
39
|
</svg>
|
|
40
40
|
</div>
|
|
41
41
|
);
|
|
@@ -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({ layout: 'column' })],
|
|
28
|
+
decorators: [withTheme(), withLayout({ layout: 'column' })],
|
|
29
29
|
} satisfies Meta<typeof IconPicker>;
|
|
30
30
|
|
|
31
31
|
export default meta;
|
|
@@ -8,7 +8,6 @@ import { type ButtonProps, Icon, type IconProps, type ThemedClassName, useTransl
|
|
|
8
8
|
import { osTranslations } from '@dxos/ui-theme';
|
|
9
9
|
|
|
10
10
|
import { PickerButton, type PickerButtonProps } from '../PickerButton';
|
|
11
|
-
|
|
12
11
|
import { iconValues } from './icons';
|
|
13
12
|
|
|
14
13
|
export type IconPickerProps = {
|
|
@@ -28,7 +27,7 @@ export const IconPicker = ({ ...props }: ThemedClassName<IconPickerProps>) => {
|
|
|
28
27
|
return (
|
|
29
28
|
<PickerButton
|
|
30
29
|
Component={IconPreview}
|
|
31
|
-
label={t('select
|
|
30
|
+
label={t('select-icon.label')}
|
|
32
31
|
icon='ph--selection--regular'
|
|
33
32
|
values={iconValues}
|
|
34
33
|
{...props}
|
|
@@ -11,7 +11,7 @@ export type PickerButtonProps = ThemedClassName<{
|
|
|
11
11
|
Component: FC<{ value: string; size?: IconProps['size'] }>;
|
|
12
12
|
label: string;
|
|
13
13
|
icon: string;
|
|
14
|
-
values: string[];
|
|
14
|
+
values: readonly string[];
|
|
15
15
|
disabled?: boolean;
|
|
16
16
|
defaultValue?: string;
|
|
17
17
|
value?: string;
|
|
@@ -50,7 +50,7 @@ export const PickerButton = ({
|
|
|
50
50
|
<DropdownMenu.Root modal={false} open={open} onOpenChange={setOpen}>
|
|
51
51
|
<Tooltip.Trigger asChild content={label} side='bottom'>
|
|
52
52
|
<DropdownMenu.Trigger asChild>
|
|
53
|
-
<TriggerRoot classNames={['gap-2
|
|
53
|
+
<TriggerRoot classNames={['gap-2 py-1', classNames]} disabled={disabled}>
|
|
54
54
|
<span className='sr-only'>{label}</span>
|
|
55
55
|
{(value && <Component value={value} size={iconSize} />) || <Icon icon={icon} size={iconSize} />}
|
|
56
56
|
<Icon icon='ph--caret-down--bold' size={3} />
|
|
@@ -58,7 +58,7 @@ export const PickerButton = ({
|
|
|
58
58
|
</DropdownMenu.Trigger>
|
|
59
59
|
</Tooltip.Trigger>
|
|
60
60
|
<DropdownMenu.Portal>
|
|
61
|
-
<DropdownMenu.Content side='bottom' classNames='!
|
|
61
|
+
<DropdownMenu.Content side='bottom' classNames='!w-min'>
|
|
62
62
|
<DropdownMenu.Viewport classNames='grid grid-cols-[repeat(6,min-content)]'>
|
|
63
63
|
{values.map((_value) => {
|
|
64
64
|
return (
|