import type { Meta, StoryObj } from '@storybook/react'; import { PxlKitLocaleProvider, TURKISH_CHARACTERS } from './locale'; import { PixelButton } from './actions'; import { PixelAvatar } from './data/PixelAvatar'; import { PixelSection } from './layout'; const SURFACES = ['pixel', 'linear'] as const; const meta: Meta = { title: 'UI Kit / Locale', parameters: { layout: 'padded' }, }; export default meta; type Story = StoryObj; /** * PxlKitLocaleProvider — wires locale-aware uppercase behaviour for components * that internally use the .upper() helper (PixelAvatar initials, PixelSection * title, PixelModal title…). * * Default English consumption works WITHOUT wrapping in the provider — these * stories show both sides side-by-side so the Turkish difference (`i → İ`) * is obvious. */ export const EnglishVsTurkish: Story = { render: (args: any) => (

English (default — no provider required)

Initials and titles use toUpperCase() as-is.

istanbul

Turkish (wrapped in provider)

Initials and titles produce İSTANBUL with the correct dotted capital I.

istanbul

Sample: {TURKISH_CHARACTERS.sample}

Pangram: {TURKISH_CHARACTERS.pangram}

), argTypes: { surface: { control: 'inline-radio', options: SURFACES } }, args: { surface: 'pixel' as const }, }; export const PxlKitLocaleProviderStory: Story = { name: 'PxlKitLocaleProvider', render: (args: any) => (
preview
), argTypes: { locale: { control: 'inline-radio', options: ['en', 'tr'] }, surface: { control: 'inline-radio', options: SURFACES }, }, args: { locale: 'tr' as const, surface: 'pixel' as const }, };