Skip to content

Commit 9fbe58d

Browse files
committed
Rename isSticky prop to sticky
1 parent 12c0523 commit 9fbe58d

File tree

4 files changed

+13
-18
lines changed

4 files changed

+13
-18
lines changed

site/src/components/sections/docs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ export function Docs({
310310
</PropertiesListRow>
311311
<PropertiesListRow
312312
defaultValue="true"
313-
name="isSticky"
313+
name="sticky"
314314
type="boolean"
315315
>
316316
<p>Whether to enable the sticky position of the category headers.</p>

src/components/emoji-picker.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ const EmojiPickerRoot = forwardRef<HTMLDivElement, EmojiPickerRootProps>(
149149
onBlurCapture,
150150
children,
151151
style,
152-
isSticky = true,
152+
sticky = true,
153153
...props
154154
},
155155
forwardedRef,
@@ -160,7 +160,7 @@ const EmojiPickerRoot = forwardRef<HTMLDivElement, EmojiPickerRootProps>(
160160
stableOnEmojiSelect,
161161
validateLocale(locale),
162162
columns,
163-
isSticky,
163+
sticky,
164164
validateSkinTone(skinTone),
165165
),
166166
);
@@ -182,8 +182,8 @@ const EmojiPickerRoot = forwardRef<HTMLDivElement, EmojiPickerRootProps>(
182182
}, [columns]);
183183

184184
useLayoutEffect(() => {
185-
store.set({ isSticky });
186-
}, [isSticky]);
185+
store.set({ sticky });
186+
}, [sticky]);
187187

188188
useLayoutEffect(() => {
189189
store.set({ skinTone: validateSkinTone(skinTone) });
@@ -775,7 +775,7 @@ function listCategoryProps(
775775
function listCategoryHeaderProps(
776776
category: EmojiPickerCategory,
777777
sizer = false,
778-
isSticky = true,
778+
sticky = true,
779779
): WithAttributes<EmojiPickerListCategoryHeaderProps> {
780780
return {
781781
category,
@@ -784,7 +784,7 @@ function listCategoryHeaderProps(
784784
contain: !sizer ? "layout paint" : undefined,
785785
height: !sizer ? "var(--frimousse-category-header-height)" : undefined,
786786
pointerEvents: "auto",
787-
position: isSticky ? "sticky" : undefined,
787+
position: sticky ? "sticky" : undefined,
788788
top: 0,
789789
},
790790
};
@@ -920,7 +920,7 @@ const EmojiPickerListCategory = memo(
920920
(state) => state.data?.categories[categoryIndex],
921921
shallow,
922922
);
923-
const isSticky = useSelectorKey(store, "isSticky");
923+
const sticky = useSelectorKey(store, "sticky");
924924

925925
/* v8 ignore next 3 */
926926
if (!category) {
@@ -933,7 +933,7 @@ const EmojiPickerListCategory = memo(
933933
{...listCategoryHeaderProps(
934934
{ label: category.label },
935935
false,
936-
isSticky,
936+
sticky,
937937
)}
938938
/>
939939
</div>

src/store.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type Interaction = "keyboard" | "pointer" | "none";
1616
export type EmojiPickerStore = {
1717
locale: Locale;
1818
columns: number;
19-
isSticky: boolean;
19+
sticky: boolean;
2020
skinTone: SkinTone;
2121
onEmojiSelect: NonNullable<EmojiPickerRootProps["onEmojiSelect"]>;
2222

@@ -60,15 +60,15 @@ export function createEmojiPickerStore(
6060
onEmojiSelect: NonNullable<EmojiPickerRootProps["onEmojiSelect"]>,
6161
initialLocale: Locale,
6262
initialColumns: number,
63-
initialIsSticky: boolean,
63+
initialSticky: boolean,
6464
initialSkinTone: SkinTone,
6565
) {
6666
let viewportScrollY = 0;
6767

6868
return createStore<EmojiPickerStore>((set, get) => ({
6969
locale: initialLocale,
7070
columns: initialColumns,
71-
isSticky: initialIsSticky,
71+
sticky: initialSticky,
7272
skinTone: initialSkinTone,
7373
onEmojiSelect,
7474

src/types.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,6 @@ export interface EmojiPickerListCategoryHeaderProps
124124
* The category for this sticky header.
125125
*/
126126
category: Category;
127-
128-
/**
129-
* Whether to enable the sticky position of the category header.
130-
*/
131-
isSticky?: boolean;
132127
}
133128

134129
export interface EmojiPickerListEmojiProps
@@ -206,7 +201,7 @@ export interface EmojiPickerRootProps extends ComponentProps<"div"> {
206201
*
207202
* @default true
208203
*/
209-
isSticky?: boolean;
204+
sticky?: boolean;
210205
}
211206

212207
export type EmojiPickerViewportProps = ComponentProps<"div">;

0 commit comments

Comments
 (0)