Replace Flux UI with TallStackUI 4
Rewrite the layout and all Customers and Users pages with TallStackUI components and remove livewire/flux and its Boost skill. Fix the TallStackUI accessibility gaps found by the axe tests: - password reveal and theme switch have no accessible name: add <x-password-field> and keep the own theme toggle button - select.native label is not tied to the control: add aria-label - contrast: darker primary palette, soft-customized error colours and published alert/link colour classes; neutral buttons use subtle black - follow the system theme by default (localStorage key dark-theme) Load TallStackUI assets from the app URL so they work in the XAMPP subfolder, add Finnish TallStackUI strings, and drop inputmode=numeric from the business ID field so iOS keyboards show the hyphen. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -1,81 +0,0 @@
|
||||
---
|
||||
name: fluxui-development
|
||||
description: "Use this skill for Flux UI development in Livewire applications only. Trigger when working with <flux:*> components, building or customizing Livewire component UIs, creating forms, modals, tables, or other interactive elements. Covers: flux: components (buttons, inputs, modals, forms, tables, date-pickers, kanban, badges, tooltips, etc.), component composition, Tailwind CSS styling, Heroicons/Lucide icon integration, validation patterns, responsive design, and theming. Do not use for non-Livewire frameworks or non-component styling."
|
||||
license: MIT
|
||||
metadata:
|
||||
author: laravel
|
||||
---
|
||||
|
||||
# Flux UI development
|
||||
|
||||
## Documentation
|
||||
|
||||
Use `search-docs` for detailed Flux UI patterns and documentation.
|
||||
|
||||
## Basic usage
|
||||
|
||||
This project uses the free edition of Flux UI, which includes all free components and variants but not Pro components.
|
||||
|
||||
Flux UI is a component library for Livewire built with Tailwind CSS.
|
||||
|
||||
Use a Flux UI component when one exists. If no Flux component fits your needs, fall back to a standard Blade component.
|
||||
|
||||
<!-- Basic Button -->
|
||||
```blade
|
||||
<flux:button variant="primary">Click me</flux:button>
|
||||
```
|
||||
|
||||
## Available components (free edition)
|
||||
|
||||
Available: avatar, badge, brand, breadcrumbs, button, callout, card, checkbox, dropdown, field, heading, icon, input, modal, navbar, otp-input, pagination, profile, progress, radio, select, separator, skeleton, switch, table, text, textarea, toast, tooltip
|
||||
|
||||
## Icons
|
||||
|
||||
Flux includes [Heroicons](https://heroicons.com/) as its default icon set. Look up exact icon names on the Heroicons site. Do not guess or invent icon names.
|
||||
|
||||
<!-- Icon Button -->
|
||||
```blade
|
||||
<flux:button icon="arrow-down-tray">Export</flux:button>
|
||||
```
|
||||
|
||||
For an icon that Heroicons lacks, use [Lucide](https://lucide.dev/). Import the icons you need with the Artisan command:
|
||||
|
||||
```bash
|
||||
php artisan flux:icon crown grip-vertical github
|
||||
```
|
||||
|
||||
## Common patterns
|
||||
|
||||
### Form fields
|
||||
|
||||
<!-- Form Field -->
|
||||
```blade
|
||||
<flux:field>
|
||||
<flux:label>Email</flux:label>
|
||||
<flux:input type="email" wire:model="email" />
|
||||
<flux:error name="email" />
|
||||
</flux:field>
|
||||
```
|
||||
|
||||
### Modals
|
||||
|
||||
<!-- Modal -->
|
||||
```blade
|
||||
<flux:modal wire:model="showModal">
|
||||
<flux:heading>Title</flux:heading>
|
||||
<p>Content</p>
|
||||
</flux:modal>
|
||||
```
|
||||
|
||||
## Verification
|
||||
|
||||
1. Check that the component renders correctly
|
||||
2. Test interactive states
|
||||
3. Verify mobile responsiveness
|
||||
|
||||
## Common pitfalls
|
||||
|
||||
- Trying to use Pro-only components in the free edition
|
||||
- Not checking whether a Flux component exists before building a custom one
|
||||
- Forgetting to use the `search-docs` tool for component-specific documentation
|
||||
- Not following the project's existing Flux patterns
|
||||
@@ -85,8 +85,6 @@ This app ships a frontend stack, so the items below apply.
|
||||
- Hint: `ls app/View/Components`. Grep `<x-`, `@include` in `resources/views`.
|
||||
30. Livewire component format: Volt functional/class components, native Livewire 4 single-file (SFC), multi-file (MFC), view-based, or class-based components. Evaluate full-page vs nested separately because it is an independent usage choice.
|
||||
- Hint: check the installed Livewire major and `livewire/volt`. Inspect `app/Livewire`, `resources/views/livewire`, and Livewire 4 component/page directories for `@volt`, SFC, MFC, view-based, and class-based formats.
|
||||
31. UI kit (Flux): Flux components vs custom components vs another library.
|
||||
- Hint: grep `<flux:` in `resources/views`.
|
||||
32. Localization: short keys (`lang/*/*.php` + `__('messages.welcome')`) vs JSON string keys (`lang/*.json` + `__('Full sentence')`).
|
||||
- Hint: `ls lang`. Grep dotted `__('` vs sentence keys.
|
||||
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
---
|
||||
name: fluxui-development
|
||||
description: "Use this skill for Flux UI development in Livewire applications only. Trigger when working with <flux:*> components, building or customizing Livewire component UIs, creating forms, modals, tables, or other interactive elements. Covers: flux: components (buttons, inputs, modals, forms, tables, date-pickers, kanban, badges, tooltips, etc.), component composition, Tailwind CSS styling, Heroicons/Lucide icon integration, validation patterns, responsive design, and theming. Do not use for non-Livewire frameworks or non-component styling."
|
||||
license: MIT
|
||||
metadata:
|
||||
author: laravel
|
||||
---
|
||||
|
||||
# Flux UI development
|
||||
|
||||
## Documentation
|
||||
|
||||
Use `search-docs` for detailed Flux UI patterns and documentation.
|
||||
|
||||
## Basic usage
|
||||
|
||||
This project uses the free edition of Flux UI, which includes all free components and variants but not Pro components.
|
||||
|
||||
Flux UI is a component library for Livewire built with Tailwind CSS.
|
||||
|
||||
Use a Flux UI component when one exists. If no Flux component fits your needs, fall back to a standard Blade component.
|
||||
|
||||
<!-- Basic Button -->
|
||||
```blade
|
||||
<flux:button variant="primary">Click me</flux:button>
|
||||
```
|
||||
|
||||
## Available components (free edition)
|
||||
|
||||
Available: avatar, badge, brand, breadcrumbs, button, callout, card, checkbox, dropdown, field, heading, icon, input, modal, navbar, otp-input, pagination, profile, progress, radio, select, separator, skeleton, switch, table, text, textarea, toast, tooltip
|
||||
|
||||
## Icons
|
||||
|
||||
Flux includes [Heroicons](https://heroicons.com/) as its default icon set. Look up exact icon names on the Heroicons site. Do not guess or invent icon names.
|
||||
|
||||
<!-- Icon Button -->
|
||||
```blade
|
||||
<flux:button icon="arrow-down-tray">Export</flux:button>
|
||||
```
|
||||
|
||||
For an icon that Heroicons lacks, use [Lucide](https://lucide.dev/). Import the icons you need with the Artisan command:
|
||||
|
||||
```bash
|
||||
php artisan flux:icon crown grip-vertical github
|
||||
```
|
||||
|
||||
## Common patterns
|
||||
|
||||
### Form fields
|
||||
|
||||
<!-- Form Field -->
|
||||
```blade
|
||||
<flux:field>
|
||||
<flux:label>Email</flux:label>
|
||||
<flux:input type="email" wire:model="email" />
|
||||
<flux:error name="email" />
|
||||
</flux:field>
|
||||
```
|
||||
|
||||
### Modals
|
||||
|
||||
<!-- Modal -->
|
||||
```blade
|
||||
<flux:modal wire:model="showModal">
|
||||
<flux:heading>Title</flux:heading>
|
||||
<p>Content</p>
|
||||
</flux:modal>
|
||||
```
|
||||
|
||||
## Verification
|
||||
|
||||
1. Check that the component renders correctly
|
||||
2. Test interactive states
|
||||
3. Verify mobile responsiveness
|
||||
|
||||
## Common pitfalls
|
||||
|
||||
- Trying to use Pro-only components in the free edition
|
||||
- Not checking whether a Flux component exists before building a custom one
|
||||
- Forgetting to use the `search-docs` tool for component-specific documentation
|
||||
- Not following the project's existing Flux patterns
|
||||
@@ -85,8 +85,6 @@ This app ships a frontend stack, so the items below apply.
|
||||
- Hint: `ls app/View/Components`. Grep `<x-`, `@include` in `resources/views`.
|
||||
30. Livewire component format: Volt functional/class components, native Livewire 4 single-file (SFC), multi-file (MFC), view-based, or class-based components. Evaluate full-page vs nested separately because it is an independent usage choice.
|
||||
- Hint: check the installed Livewire major and `livewire/volt`. Inspect `app/Livewire`, `resources/views/livewire`, and Livewire 4 component/page directories for `@volt`, SFC, MFC, view-based, and class-based formats.
|
||||
31. UI kit (Flux): Flux components vs custom components vs another library.
|
||||
- Hint: grep `<flux:` in `resources/views`.
|
||||
32. Localization: short keys (`lang/*/*.php` + `__('messages.welcome')`) vs JSON string keys (`lang/*.json` + `__('Full sentence')`).
|
||||
- Hint: `ls lang`. Grep dotted `__('` vs sentence keys.
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
||||
|
||||
## Project
|
||||
|
||||
An ERP / work-management system (*toiminnanohjausjärjestelmä*) for a small (5–10 person) Finnish media/marketing company. Stack: Laravel 13, Livewire 4 (single-file components), Flux UI 2 free edition, Tailwind 4, Vite 8, Pest, Larastan. Domain code lives in modules under `app/Modules` (so far `Shared`, `Users` and `Customers`); `/` is still a temporary Livewire demo page behind login (`resources/views/pages/⚡home.blade.php`, layout `resources/views/layouts/app.blade.php`, which has the main menu and logout for signed-in users).
|
||||
An ERP / work-management system (*toiminnanohjausjärjestelmä*) for a small (5–10 person) Finnish media/marketing company. Stack: Laravel 13, Livewire 4 (single-file components), TallStackUI 4 (Blade components, no prefix: `<x-input>`, `<x-button>`), Tailwind 4, Vite 8, Pest, Larastan. Domain code lives in modules under `app/Modules` (so far `Shared`, `Users` and `Customers`); `/` is still a temporary Livewire demo page behind login (`resources/views/pages/⚡home.blade.php`, layout `resources/views/layouts/app.blade.php`, which has the main menu and logout for signed-in users).
|
||||
|
||||
- **The specification is `määrittely.txt`** (Finnish). It defines users/roles, customer jobs (*asiakastyö*) and their fields and enums, time tracking, expenses, Kanban tasks, the service unit → service → work task hierarchy, and billing-material export. It ends with Claude's open questions and a proposed phased plan. Read it before designing any domain feature.
|
||||
- **Language rule:** code (identifiers, tables, columns, enum keys) is in English; the specification and the UI are in Finnish. Keep UI strings in translation files from the start.
|
||||
@@ -32,14 +32,21 @@ Read `docs/architecture.md` (Finnish) before adding or changing domain code. `ap
|
||||
|
||||
Accessibility is a contractual acceptance criterion. It covers the whole UI: navigation, forms, tables, reports, notifications, dialogs, login, and every business process. Every new or changed view must meet these rules:
|
||||
|
||||
- Use Flux components first; they ship with correct roles, focus handling and keyboard support. Every form control goes in `flux:field` with a `flux:label` and a `flux:error` (or uses the shorthand `label` prop). Placeholder text is not a label.
|
||||
- **UI components are TallStackUI.** Read the component's page in `vendor/tallstackui/tallstackui/.ai/components/` (index: `.ai/index.md`) before writing a tag; never guess props. Every form control has a visible `label` prop; TallStackUI shows the `wire:model` validation error under it. Placeholder text is not a label. Submit buttons use the `submit` prop, never `type="submit"`.
|
||||
- **TallStackUI accessibility gaps and the project fixes** (keep them; the axe tests catch regressions):
|
||||
- `<x-password>`: its reveal button has no name. Use `<x-password-field>` (`resources/views/components/password-field.blade.php`).
|
||||
- `<x-theme-switch>`: unnamed `role="switch"`. Use `resources/views/partials/theme-toggle.blade.php`, which drives `tallstackui_darkTheme({ default: 'system' })` on `<html>` (localStorage `dark-theme`; an inline script in the layout applies it before paint).
|
||||
- `<tallstackui:script />`: root-relative asset URLs that 404 in a subfolder (local XAMPP). The layout includes `resources/views/partials/tallstackui-script.blade.php` instead.
|
||||
- `<x-select.native>`: the label is not tied to the control, so also pass `:aria-label` with the same text.
|
||||
- Contrast: the primary palette is one step darker (`resources/css/app.css`); error text, label error and asterisk, and input/select error colours are changed by soft customization in `App\Providers\AppServiceProvider`; light alert and link text colours are in published colour classes `app/View/Components/TallStackUi/Colors/`. `flat` and `outline` buttons have no dark-mode text colour: use `subtle color="black"` for neutral buttons.
|
||||
- Finnish strings for TallStackUI's own components are in `lang/vendor/ts-ui/fi/messages.php`.
|
||||
- Never convey meaning by colour alone. Statuses, priorities (e.g. *kiire* = red), errors and warnings always also have visible text or an icon with text.
|
||||
- Announce dynamic changes: put status text in `role="status"` / `aria-live="polite"` (errors: `role="alert"`), or use Flux toast. Keep button names stable instead of putting changing state in them.
|
||||
- Make everything work with the keyboard alone, with a visible focus indicator and no focus traps. Use `flux:modal` for dialogs, so focus moves in and returns.
|
||||
- Announce dynamic changes: put status text in `role="status"` / `aria-live="polite"` (errors: `role="alert"`), or a TallStackUI toast (`<x-toast />` must then be added to the layout). Keep button names stable instead of putting changing state in them.
|
||||
- Make everything work with the keyboard alone, with a visible focus indicator and no focus traps. Use `<x-modal>` for dialogs and check that focus moves in and returns.
|
||||
- The layout (`resources/views/layouts/app.blade.php`) provides a skip link and a `<main id="main-content">` landmark. Keep them, and add `<nav aria-label="…">` for navigation.
|
||||
- One `h1` per page, logical heading order, and a descriptive page `#[Title]` on every page component.
|
||||
- Data tables use `flux:table` with column headers. Icon-only buttons need an accessible name (`aria-label` or Flux `tooltip`). Decorative images get `alt=""`.
|
||||
- Contrast is at least 4.5:1 for text and 3:1 for UI components and focus indicators, in both light and dark mode. Flux's default error text (red-500) fails this, so `resources/css/app.css` overrides `[data-flux-error]`. `flux:callout variant="warning"` also fails in light mode (2.8:1): use the default callout with a warning icon.
|
||||
- Data tables use `<x-table>` with `headers` (custom cells with `@interact('column_<index>', $row)`). Icon-only buttons need an `aria-label` (a `tooltip` alone is not a name). Decorative images get `alt=""`.
|
||||
- Contrast is at least 4.5:1 for text and 3:1 for UI components and focus indicators, in both light and dark mode.
|
||||
- Layouts must reflow at 320 px width and 400 % zoom without horizontal scrolling. Touch targets are at least 24×24 px.
|
||||
- Every new page gets a browser test in `tests/Browser` that uses `assertNoAccessibilityIssues(level: 2)` in light and dark mode and on desktop and mobile. See `tests/Browser/AccessibilityTest.php`. Automated axe checks catch only part of WCAG: also check new flows manually with the keyboard and a screen reader (NVDA).
|
||||
|
||||
|
||||
@@ -69,43 +69,37 @@ new class extends Component
|
||||
?>
|
||||
|
||||
<div class="mx-auto max-w-2xl space-y-6 p-4 sm:p-6">
|
||||
<flux:heading size="xl" level="1">
|
||||
<h1 class="text-2xl font-semibold">
|
||||
{{ __($customerId === null ? 'customers.create_title' : 'customers.edit_title') }}
|
||||
</flux:heading>
|
||||
</h1>
|
||||
|
||||
<form wire:submit="save" class="space-y-6" novalidate>
|
||||
<flux:input
|
||||
<x-input
|
||||
wire:model="form.name"
|
||||
:label="__('customers.fields.name')"
|
||||
autocomplete="organization"
|
||||
required
|
||||
/>
|
||||
|
||||
<flux:radio.group wire:model.live="form.type" :label="__('customers.fields.type')">
|
||||
@foreach (CustomerType::cases() as $customerType)
|
||||
<flux:radio
|
||||
wire:key="type-{{ $customerType->value }}"
|
||||
:value="$customerType->value"
|
||||
:label="__('customers.types.'.$customerType->value)"
|
||||
<x-radio.group
|
||||
wire:model.live="form.type"
|
||||
:label="__('customers.fields.type')"
|
||||
:options="collect(CustomerType::cases())->map(fn (CustomerType $type) => ['label' => __('customers.types.'.$type->value), 'value' => $type->value])->all()"
|
||||
/>
|
||||
@endforeach
|
||||
</flux:radio.group>
|
||||
|
||||
@if ($form->type === CustomerType::Company->value)
|
||||
<flux:input
|
||||
{{-- No inputmode="numeric": the iOS number pad has no hyphen for 1234567-8. --}}
|
||||
<x-input
|
||||
wire:model="form.business_id"
|
||||
:label="__('customers.fields.business_id')"
|
||||
:description="__('customers.fields.business_id_description')"
|
||||
inputmode="numeric"
|
||||
:hint="__('customers.fields.business_id_description')"
|
||||
autocomplete="off"
|
||||
/>
|
||||
@endif
|
||||
|
||||
<div class="flex flex-wrap gap-3">
|
||||
<flux:button type="submit" variant="primary">{{ __('customers.save') }}</flux:button>
|
||||
<flux:button :href="route('customers.index')" wire:navigate variant="ghost">
|
||||
{{ __('customers.cancel') }}
|
||||
</flux:button>
|
||||
<x-button submit :text="__('customers.save')" />
|
||||
<x-button :href="route('customers.index')" wire:navigate subtle color="black" :text="__('customers.cancel')" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -41,6 +41,19 @@ new class extends Component
|
||||
return $this->customerQueries->paginate($this->search);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<array{index: string, label: string, sortable: bool, align?: string}>
|
||||
*/
|
||||
public function headers(): array
|
||||
{
|
||||
return [
|
||||
['index' => 'name', 'label' => __('customers.fields.name'), 'sortable' => false],
|
||||
['index' => 'type', 'label' => __('customers.fields.type'), 'sortable' => false],
|
||||
['index' => 'businessId', 'label' => __('customers.fields.business_id'), 'sortable' => false],
|
||||
['index' => 'action', 'label' => __('customers.actions'), 'sortable' => false, 'align' => 'right'],
|
||||
];
|
||||
}
|
||||
|
||||
public function render(): mixed
|
||||
{
|
||||
return $this->view()->title(__('customers.title'));
|
||||
@@ -50,54 +63,48 @@ new class extends Component
|
||||
|
||||
<div class="mx-auto max-w-5xl space-y-6 p-4 sm:p-6">
|
||||
<div class="flex flex-wrap items-center justify-between gap-4">
|
||||
<flux:heading size="xl" level="1">{{ __('customers.title') }}</flux:heading>
|
||||
<h1 class="text-2xl font-semibold">{{ __('customers.title') }}</h1>
|
||||
|
||||
<flux:button :href="route('customers.create')" wire:navigate variant="primary" icon="plus">
|
||||
{{ __('customers.new') }}
|
||||
</flux:button>
|
||||
<x-button :href="route('customers.create')" wire:navigate icon="plus" :text="__('customers.new')" />
|
||||
</div>
|
||||
|
||||
@if (session('status'))
|
||||
<flux:callout variant="success" icon="check-circle" role="status" :heading="session('status')" />
|
||||
<x-alert role="status" color="green" light icon="check-circle" :text="session('status')" />
|
||||
@endif
|
||||
|
||||
<flux:input
|
||||
<x-input
|
||||
wire:model.live.debounce.300ms="search"
|
||||
type="search"
|
||||
icon="magnifying-glass"
|
||||
:label="__('customers.search')"
|
||||
:description="__('customers.search_description')"
|
||||
:hint="__('customers.search_description')"
|
||||
/>
|
||||
|
||||
<flux:text role="status" aria-live="polite" aria-atomic="true">
|
||||
<p role="status" aria-live="polite" aria-atomic="true" class="text-sm text-zinc-600 dark:text-zinc-300">
|
||||
{{ trans_choice('customers.result_count', $this->customers->total(), ['count' => $this->customers->total()]) }}
|
||||
</flux:text>
|
||||
</p>
|
||||
|
||||
@if ($this->customers->total() === 0)
|
||||
<flux:text>{{ __('customers.empty') }}</flux:text>
|
||||
<p class="text-sm text-zinc-600 dark:text-zinc-300">{{ __('customers.empty') }}</p>
|
||||
@else
|
||||
<flux:table :paginate="$this->customers">
|
||||
<flux:table.columns>
|
||||
<flux:table.column>{{ __('customers.fields.name') }}</flux:table.column>
|
||||
<flux:table.column>{{ __('customers.fields.type') }}</flux:table.column>
|
||||
<flux:table.column>{{ __('customers.fields.business_id') }}</flux:table.column>
|
||||
<flux:table.column><span class="sr-only">{{ __('customers.edit') }}</span></flux:table.column>
|
||||
</flux:table.columns>
|
||||
<x-table :headers="$this->headers()" :rows="$this->customers" paginate>
|
||||
@interact('column_name', $customer)
|
||||
<span class="font-medium">{{ $customer->name }}</span>
|
||||
@endinteract
|
||||
|
||||
<flux:table.rows>
|
||||
@foreach ($this->customers as $customer)
|
||||
<flux:table.row wire:key="customer-{{ $customer->id }}">
|
||||
<flux:table.cell variant="strong">{{ $customer->name }}</flux:table.cell>
|
||||
<flux:table.cell>{{ __('customers.types.'.$customer->type->value) }}</flux:table.cell>
|
||||
<flux:table.cell>{{ $customer->businessId ?? '–' }}</flux:table.cell>
|
||||
<flux:table.cell align="end">
|
||||
<flux:link :href="route('customers.edit', $customer->id)" wire:navigate>
|
||||
@interact('column_type', $customer)
|
||||
{{ __('customers.types.'.$customer->type->value) }}
|
||||
@endinteract
|
||||
|
||||
@interact('column_businessId', $customer)
|
||||
{{ $customer->businessId ?? '–' }}
|
||||
@endinteract
|
||||
|
||||
@interact('column_action', $customer)
|
||||
<x-link :href="route('customers.edit', $customer->id)" navigate>
|
||||
{{ __('customers.edit') }}<span class="sr-only">: {{ $customer->name }}</span>
|
||||
</flux:link>
|
||||
</flux:table.cell>
|
||||
</flux:table.row>
|
||||
@endforeach
|
||||
</flux:table.rows>
|
||||
</flux:table>
|
||||
</x-link>
|
||||
@endinteract
|
||||
</x-table>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@@ -36,22 +36,22 @@ new class extends Component
|
||||
?>
|
||||
|
||||
<div class="mx-auto max-w-md space-y-6 p-4 sm:p-6 sm:pt-16">
|
||||
<flux:heading size="xl" level="1">{{ __('auth.forgot_title') }}</flux:heading>
|
||||
<h1 class="text-2xl font-semibold">{{ __('auth.forgot_title') }}</h1>
|
||||
|
||||
<div role="status" aria-live="polite">
|
||||
@if ($linkRequested)
|
||||
<flux:callout variant="success" icon="envelope" :heading="__('auth.forgot_sent')" />
|
||||
<x-alert color="green" light icon="envelope" :text="__('auth.forgot_sent')" />
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<flux:text>{{ __('auth.forgot_intro') }}</flux:text>
|
||||
<p class="text-sm text-zinc-600 dark:text-zinc-300">{{ __('auth.forgot_intro') }}</p>
|
||||
|
||||
<form wire:submit="sendLink" class="space-y-6" novalidate>
|
||||
<flux:input wire:model="email" type="email" :label="__('auth.email')" autocomplete="username" required />
|
||||
<x-input wire:model="email" type="email" :label="__('auth.email')" autocomplete="username" required />
|
||||
|
||||
<div class="flex flex-wrap items-center justify-between gap-4">
|
||||
<flux:button type="submit" variant="primary">{{ __('auth.forgot_submit') }}</flux:button>
|
||||
<flux:link :href="route('login')" wire:navigate>{{ __('auth.back_to_login') }}</flux:link>
|
||||
<x-button submit :text="__('auth.forgot_submit')" />
|
||||
<x-link :href="route('login')" navigate :text="__('auth.back_to_login')" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -103,60 +103,63 @@ new class extends Component
|
||||
?>
|
||||
|
||||
<div class="mx-auto max-w-2xl space-y-6 p-4 sm:p-6">
|
||||
<flux:heading size="xl" level="1">
|
||||
<h1 class="text-2xl font-semibold">
|
||||
{{ __($userId === null ? 'users.create_title' : 'users.edit_title') }}
|
||||
</flux:heading>
|
||||
</h1>
|
||||
|
||||
<form wire:submit="save" class="space-y-6" novalidate>
|
||||
<flux:input wire:model="form.name" :label="__('users.fields.name')" autocomplete="off" required />
|
||||
<x-input wire:model="form.name" :label="__('users.fields.name')" autocomplete="off" required />
|
||||
|
||||
<flux:input wire:model="form.email" type="email" :label="__('users.fields.email')" autocomplete="off" required />
|
||||
<x-input wire:model="form.email" type="email" :label="__('users.fields.email')" autocomplete="off" required />
|
||||
|
||||
<flux:select wire:model.live="form.role" :label="__('users.fields.role')">
|
||||
@foreach (Role::cases() as $role)
|
||||
<flux:select.option wire:key="role-{{ $role->value }}" :value="$role->value">
|
||||
{{ __('users.roles.'.$role->value) }}
|
||||
</flux:select.option>
|
||||
@endforeach
|
||||
</flux:select>
|
||||
{{-- TallStackUI's native select does not tie its label to the control, so aria-label names it. --}}
|
||||
<x-select.native
|
||||
wire:model.live="form.role"
|
||||
:label="__('users.fields.role')"
|
||||
:aria-label="__('users.fields.role')"
|
||||
:options="collect(Role::cases())->map(fn (Role $role) => ['label' => __('users.roles.'.$role->value), 'value' => $role->value])->all()"
|
||||
/>
|
||||
|
||||
@if ($form->isIntern())
|
||||
<flux:input
|
||||
<x-input
|
||||
wire:model="form.employment_ends_on"
|
||||
type="date"
|
||||
:label="__('users.fields.employment_ends_on')"
|
||||
:description="__('users.fields.employment_ends_on_description')"
|
||||
:hint="__('users.fields.employment_ends_on_description')"
|
||||
required
|
||||
/>
|
||||
|
||||
<flux:select wire:model="form.supervisor_id" :label="__('users.fields.supervisor')" :placeholder="__('users.fields.supervisor_placeholder')">
|
||||
<x-select.native
|
||||
wire:model="form.supervisor_id"
|
||||
:label="__('users.fields.supervisor')"
|
||||
:aria-label="__('users.fields.supervisor')"
|
||||
required
|
||||
>
|
||||
<option value="">{{ __('users.fields.supervisor_placeholder') }}</option>
|
||||
@foreach ($this->supervisorOptions as $option)
|
||||
<flux:select.option wire:key="supervisor-{{ $option->id }}" :value="(string) $option->id">
|
||||
{{ $option->name }}
|
||||
</flux:select.option>
|
||||
<option wire:key="supervisor-{{ $option->id }}" value="{{ $option->id }}">{{ $option->name }}</option>
|
||||
@endforeach
|
||||
</flux:select>
|
||||
</x-select.native>
|
||||
@endif
|
||||
|
||||
<flux:checkbox
|
||||
wire:model="form.active"
|
||||
:label="__('users.fields.active')"
|
||||
:description="__('users.fields.active_description')"
|
||||
/>
|
||||
<div>
|
||||
<x-checkbox wire:model="form.active" :label="__('users.fields.active')" aria-describedby="active-description" />
|
||||
<p id="active-description" class="mt-1 text-sm text-zinc-600 dark:text-zinc-300">{{ __('users.fields.active_description') }}</p>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap gap-3">
|
||||
<flux:button type="submit" variant="primary">{{ __('users.save') }}</flux:button>
|
||||
<flux:button :href="route('users.index')" wire:navigate variant="ghost">{{ __('users.cancel') }}</flux:button>
|
||||
<x-button submit :text="__('users.save')" />
|
||||
<x-button :href="route('users.index')" wire:navigate subtle color="black" :text="__('users.cancel')" />
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@if ($userId !== null)
|
||||
<div class="space-y-3 border-t border-zinc-200 pt-6 dark:border-zinc-700">
|
||||
<flux:button wire:click="sendPasswordLink" icon="envelope">{{ __('users.send_link') }}</flux:button>
|
||||
<x-button wire:click="sendPasswordLink" subtle color="black" icon="envelope" :text="__('users.send_link')" />
|
||||
|
||||
<div role="status" aria-live="polite">
|
||||
@if ($linkStatus !== '')
|
||||
<flux:text>{{ $linkStatus }}</flux:text>
|
||||
<p class="text-sm">{{ $linkStatus }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -60,6 +60,20 @@ new class extends Component
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<array{index: string, label: string, sortable: bool, align?: string}>
|
||||
*/
|
||||
public function headers(): array
|
||||
{
|
||||
return [
|
||||
['index' => 'name', 'label' => __('users.fields.name'), 'sortable' => false],
|
||||
['index' => 'email', 'label' => __('users.fields.email'), 'sortable' => false],
|
||||
['index' => 'role', 'label' => __('users.fields.role'), 'sortable' => false],
|
||||
['index' => 'status', 'label' => __('users.fields.status'), 'sortable' => false],
|
||||
['index' => 'action', 'label' => __('users.actions'), 'sortable' => false, 'align' => 'right'],
|
||||
];
|
||||
}
|
||||
|
||||
public function render(): mixed
|
||||
{
|
||||
return $this->view()->title(__('users.title'));
|
||||
@@ -69,63 +83,53 @@ new class extends Component
|
||||
|
||||
<div class="mx-auto max-w-5xl space-y-6 p-4 sm:p-6">
|
||||
<div class="flex flex-wrap items-center justify-between gap-4">
|
||||
<flux:heading size="xl" level="1">{{ __('users.title') }}</flux:heading>
|
||||
<h1 class="text-2xl font-semibold">{{ __('users.title') }}</h1>
|
||||
|
||||
<flux:button :href="route('users.create')" wire:navigate variant="primary" icon="plus">
|
||||
{{ __('users.new') }}
|
||||
</flux:button>
|
||||
<x-button :href="route('users.create')" wire:navigate icon="plus" :text="__('users.new')" />
|
||||
</div>
|
||||
|
||||
@if (session('status'))
|
||||
<flux:callout variant="success" icon="check-circle" role="status" :heading="session('status')" />
|
||||
<x-alert role="status" color="green" light icon="check-circle" :text="session('status')" />
|
||||
@endif
|
||||
|
||||
<flux:input
|
||||
<x-input
|
||||
wire:model.live.debounce.300ms="search"
|
||||
type="search"
|
||||
icon="magnifying-glass"
|
||||
:label="__('users.search')"
|
||||
:description="__('users.search_description')"
|
||||
:hint="__('users.search_description')"
|
||||
/>
|
||||
|
||||
<flux:text role="status" aria-live="polite" aria-atomic="true">
|
||||
<p role="status" aria-live="polite" aria-atomic="true" class="text-sm text-zinc-600 dark:text-zinc-300">
|
||||
{{ trans_choice('users.result_count', $this->users->total(), ['count' => $this->users->total()]) }}
|
||||
</flux:text>
|
||||
</p>
|
||||
|
||||
@if ($this->users->total() === 0)
|
||||
<flux:text>{{ __('users.empty') }}</flux:text>
|
||||
<p class="text-sm text-zinc-600 dark:text-zinc-300">{{ __('users.empty') }}</p>
|
||||
@else
|
||||
<flux:table :paginate="$this->users">
|
||||
<flux:table.columns>
|
||||
<flux:table.column>{{ __('users.fields.name') }}</flux:table.column>
|
||||
<flux:table.column>{{ __('users.fields.email') }}</flux:table.column>
|
||||
<flux:table.column>{{ __('users.fields.role') }}</flux:table.column>
|
||||
<flux:table.column>{{ __('users.fields.status') }}</flux:table.column>
|
||||
<flux:table.column><span class="sr-only">{{ __('users.edit') }}</span></flux:table.column>
|
||||
</flux:table.columns>
|
||||
<x-table :headers="$this->headers()" :rows="$this->users" paginate>
|
||||
@interact('column_name', $user)
|
||||
<span class="font-medium">{{ $user->name }}</span>
|
||||
@endinteract
|
||||
|
||||
<flux:table.rows>
|
||||
@foreach ($this->users as $user)
|
||||
<flux:table.row wire:key="user-{{ $user->id }}">
|
||||
<flux:table.cell variant="strong">{{ $user->name }}</flux:table.cell>
|
||||
<flux:table.cell>{{ $user->email }}</flux:table.cell>
|
||||
<flux:table.cell>
|
||||
@interact('column_role', $user)
|
||||
{{ __('users.roles.'.$user->role->value) }}
|
||||
@if ($user->supervisorName)
|
||||
<span class="block text-xs text-zinc-600 dark:text-zinc-300">
|
||||
{{ __('users.fields.supervisor') }}: {{ $user->supervisorName }}
|
||||
</span>
|
||||
@endif
|
||||
</flux:table.cell>
|
||||
<flux:table.cell>{{ $this->statusOf($user) }}</flux:table.cell>
|
||||
<flux:table.cell align="end">
|
||||
<flux:link :href="route('users.edit', $user->id)" wire:navigate>
|
||||
@endinteract
|
||||
|
||||
@interact('column_status', $user)
|
||||
{{ $this->statusOf($user) }}
|
||||
@endinteract
|
||||
|
||||
@interact('column_action', $user)
|
||||
<x-link :href="route('users.edit', $user->id)" navigate>
|
||||
{{ __('users.edit') }}<span class="sr-only">: {{ $user->name }}</span>
|
||||
</flux:link>
|
||||
</flux:table.cell>
|
||||
</flux:table.row>
|
||||
@endforeach
|
||||
</flux:table.rows>
|
||||
</flux:table>
|
||||
</x-link>
|
||||
@endinteract
|
||||
</x-table>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@@ -80,17 +80,16 @@ new class extends Component
|
||||
?>
|
||||
|
||||
<div class="mx-auto max-w-md space-y-6 p-4 sm:p-6 sm:pt-16">
|
||||
<flux:heading size="xl" level="1">{{ __('auth.login_title') }}</flux:heading>
|
||||
<h1 class="text-2xl font-semibold">{{ __('auth.login_title') }}</h1>
|
||||
|
||||
@if ($accessEnded)
|
||||
{{-- Not variant="warning": its yellow heading is only 2.8:1 on the light background. --}}
|
||||
<flux:callout icon="exclamation-triangle" role="status" :heading="__('auth.account_disabled')" />
|
||||
<x-alert role="status" color="yellow" light icon="exclamation-triangle" :text="__('auth.account_disabled')" />
|
||||
@elseif (session('status'))
|
||||
<flux:callout variant="success" icon="information-circle" role="status" :heading="session('status')" />
|
||||
<x-alert role="status" color="green" light icon="information-circle" :text="session('status')" />
|
||||
@endif
|
||||
|
||||
<form wire:submit="login" class="space-y-6" novalidate>
|
||||
<flux:input
|
||||
<x-input
|
||||
wire:model="email"
|
||||
type="email"
|
||||
:label="__('auth.email')"
|
||||
@@ -98,20 +97,18 @@ new class extends Component
|
||||
required
|
||||
/>
|
||||
|
||||
<flux:input
|
||||
<x-password-field
|
||||
wire:model="password"
|
||||
type="password"
|
||||
:label="__('auth.password_label')"
|
||||
autocomplete="current-password"
|
||||
viewable
|
||||
required
|
||||
/>
|
||||
|
||||
<flux:checkbox wire:model="remember" :label="__('auth.remember')" />
|
||||
<x-checkbox wire:model="remember" :label="__('auth.remember')" />
|
||||
|
||||
<div class="flex flex-wrap items-center justify-between gap-4">
|
||||
<flux:button type="submit" variant="primary">{{ __('auth.login') }}</flux:button>
|
||||
<flux:link :href="route('password.request')" wire:navigate>{{ __('auth.forgot_password') }}</flux:link>
|
||||
<x-button submit :text="__('auth.login')" />
|
||||
<x-link :href="route('password.request')" navigate :text="__('auth.forgot_password')" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -74,32 +74,28 @@ new class extends Component
|
||||
?>
|
||||
|
||||
<div class="mx-auto max-w-md space-y-6 p-4 sm:p-6 sm:pt-16">
|
||||
<flux:heading size="xl" level="1">{{ __('auth.reset_title') }}</flux:heading>
|
||||
<h1 class="text-2xl font-semibold">{{ __('auth.reset_title') }}</h1>
|
||||
|
||||
<flux:text>{{ __('auth.reset_intro') }}</flux:text>
|
||||
<p class="text-sm text-zinc-600 dark:text-zinc-300">{{ __('auth.reset_intro') }}</p>
|
||||
|
||||
<form wire:submit="resetPassword" class="space-y-6" novalidate>
|
||||
<flux:input wire:model="email" type="email" :label="__('auth.email')" autocomplete="username" required />
|
||||
<x-input wire:model="email" type="email" :label="__('auth.email')" autocomplete="username" required />
|
||||
|
||||
<flux:input
|
||||
<x-password-field
|
||||
wire:model="password"
|
||||
type="password"
|
||||
:label="__('auth.new_password')"
|
||||
:description="__('auth.password_rules')"
|
||||
:hint="__('auth.password_rules')"
|
||||
autocomplete="new-password"
|
||||
viewable
|
||||
required
|
||||
/>
|
||||
|
||||
<flux:input
|
||||
<x-password-field
|
||||
wire:model="password_confirmation"
|
||||
type="password"
|
||||
:label="__('auth.confirm_password')"
|
||||
autocomplete="new-password"
|
||||
viewable
|
||||
required
|
||||
/>
|
||||
|
||||
<flux:button type="submit" variant="primary">{{ __('auth.reset_submit') }}</flux:button>
|
||||
<x-button submit :text="__('auth.reset_submit')" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use TallStackUi\Facades\TallStackUi;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
@@ -19,6 +20,40 @@ class AppServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
//
|
||||
$this->meetContrastRequirements();
|
||||
}
|
||||
|
||||
/**
|
||||
* TallStackUI uses red-500 for error text, which is 3.8:1 on white and
|
||||
* below the 4.5:1 WCAG 2.2 AA requires. Darker red in light mode, lighter
|
||||
* red in dark mode.
|
||||
*/
|
||||
private function meetContrastRequirements(): void
|
||||
{
|
||||
TallStackUi::customize()
|
||||
->form('error')
|
||||
->block('text')
|
||||
->replace('text-red-500', 'text-red-700 dark:text-red-400');
|
||||
|
||||
TallStackUi::customize()
|
||||
->form('label')
|
||||
->block('error')
|
||||
->replace(['text-red-600' => 'text-red-700', 'dark:text-red-500' => 'dark:text-red-400']);
|
||||
|
||||
TallStackUi::customize()
|
||||
->form('label')
|
||||
->block('asterisk')
|
||||
->replace('text-red-500', 'text-red-700 dark:text-red-400');
|
||||
|
||||
// The typed value of a field in error is red-600: 3.8:1 on the dark input background.
|
||||
TallStackUi::customize()
|
||||
->form('input')
|
||||
->block('error')
|
||||
->replace('text-red-600!', 'text-red-700! dark:!text-red-400');
|
||||
|
||||
TallStackUi::customize()
|
||||
->select('native')
|
||||
->block('error')
|
||||
->replace('text-red-600!', 'text-red-700! dark:!text-red-400');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,261 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\TallStackUi\Colors;
|
||||
|
||||
use Illuminate\View\Component;
|
||||
|
||||
/**
|
||||
* TallStackUI alert colours, published from the package stub. Only the light
|
||||
* variant's text is changed: the defaults (text-*-600 on bg-*-50) are below the
|
||||
* 4.5:1 contrast WCAG 2.2 AA requires. Null keeps the package default.
|
||||
*/
|
||||
class AlertColors
|
||||
{
|
||||
/**
|
||||
* Background colors.
|
||||
*
|
||||
* @return array<string, array<string, string|null>>
|
||||
*/
|
||||
public function backgroundColors(Component $component): array
|
||||
{
|
||||
return [
|
||||
'solid' => [
|
||||
'black' => null,
|
||||
'primary' => null,
|
||||
'secondary' => null,
|
||||
'slate' => null,
|
||||
'gray' => null,
|
||||
'zinc' => null,
|
||||
'neutral' => null,
|
||||
'stone' => null,
|
||||
'red' => null,
|
||||
'orange' => null,
|
||||
'amber' => null,
|
||||
'yellow' => null,
|
||||
'lime' => null,
|
||||
'green' => null,
|
||||
'emerald' => null,
|
||||
'teal' => null,
|
||||
'cyan' => null,
|
||||
'sky' => null,
|
||||
'blue' => null,
|
||||
'indigo' => null,
|
||||
'violet' => null,
|
||||
'purple' => null,
|
||||
'fuchsia' => null,
|
||||
'pink' => null,
|
||||
'rose' => null,
|
||||
'mauve' => null,
|
||||
'olive' => null,
|
||||
'mist' => null,
|
||||
'taupe' => null,
|
||||
],
|
||||
'outline' => [
|
||||
'black' => null,
|
||||
'primary' => null,
|
||||
'secondary' => null,
|
||||
'slate' => null,
|
||||
'gray' => null,
|
||||
'zinc' => null,
|
||||
'neutral' => null,
|
||||
'stone' => null,
|
||||
'red' => null,
|
||||
'orange' => null,
|
||||
'amber' => null,
|
||||
'yellow' => null,
|
||||
'lime' => null,
|
||||
'green' => null,
|
||||
'emerald' => null,
|
||||
'teal' => null,
|
||||
'cyan' => null,
|
||||
'sky' => null,
|
||||
'blue' => null,
|
||||
'indigo' => null,
|
||||
'violet' => null,
|
||||
'purple' => null,
|
||||
'fuchsia' => null,
|
||||
'pink' => null,
|
||||
'rose' => null,
|
||||
'mauve' => null,
|
||||
'olive' => null,
|
||||
'mist' => null,
|
||||
'taupe' => null,
|
||||
],
|
||||
'light' => [
|
||||
'black' => null,
|
||||
'primary' => null,
|
||||
'secondary' => null,
|
||||
'slate' => null,
|
||||
'gray' => null,
|
||||
'zinc' => null,
|
||||
'neutral' => null,
|
||||
'stone' => null,
|
||||
'red' => null,
|
||||
'orange' => null,
|
||||
'amber' => null,
|
||||
'yellow' => null,
|
||||
'lime' => null,
|
||||
'green' => null,
|
||||
'emerald' => null,
|
||||
'teal' => null,
|
||||
'cyan' => null,
|
||||
'sky' => null,
|
||||
'blue' => null,
|
||||
'indigo' => null,
|
||||
'violet' => null,
|
||||
'purple' => null,
|
||||
'fuchsia' => null,
|
||||
'pink' => null,
|
||||
'rose' => null,
|
||||
'mauve' => null,
|
||||
'olive' => null,
|
||||
'mist' => null,
|
||||
'taupe' => null,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Text colors.
|
||||
*
|
||||
* @return array<string, array<string, string|null>>
|
||||
*/
|
||||
public function textColors(Component $component): array
|
||||
{
|
||||
return [
|
||||
'solid' => [
|
||||
'black' => null,
|
||||
'primary' => null,
|
||||
'secondary' => null,
|
||||
'slate' => null,
|
||||
'gray' => null,
|
||||
'zinc' => null,
|
||||
'neutral' => null,
|
||||
'stone' => null,
|
||||
'red' => null,
|
||||
'orange' => null,
|
||||
'amber' => null,
|
||||
'yellow' => null,
|
||||
'lime' => null,
|
||||
'green' => null,
|
||||
'emerald' => null,
|
||||
'teal' => null,
|
||||
'cyan' => null,
|
||||
'sky' => null,
|
||||
'blue' => null,
|
||||
'indigo' => null,
|
||||
'violet' => null,
|
||||
'purple' => null,
|
||||
'fuchsia' => null,
|
||||
'pink' => null,
|
||||
'rose' => null,
|
||||
'mauve' => null,
|
||||
'olive' => null,
|
||||
'mist' => null,
|
||||
'taupe' => null,
|
||||
],
|
||||
'outline' => [
|
||||
'black' => null,
|
||||
'primary' => null,
|
||||
'secondary' => null,
|
||||
'slate' => null,
|
||||
'gray' => null,
|
||||
'zinc' => null,
|
||||
'neutral' => null,
|
||||
'stone' => null,
|
||||
'red' => null,
|
||||
'orange' => null,
|
||||
'amber' => null,
|
||||
'yellow' => null,
|
||||
'lime' => null,
|
||||
'green' => null,
|
||||
'emerald' => null,
|
||||
'teal' => null,
|
||||
'cyan' => null,
|
||||
'sky' => null,
|
||||
'blue' => null,
|
||||
'indigo' => null,
|
||||
'violet' => null,
|
||||
'purple' => null,
|
||||
'fuchsia' => null,
|
||||
'pink' => null,
|
||||
'rose' => null,
|
||||
'mauve' => null,
|
||||
'olive' => null,
|
||||
'mist' => null,
|
||||
'taupe' => null,
|
||||
],
|
||||
'light' => [
|
||||
'black' => null,
|
||||
'primary' => 'text-primary-800',
|
||||
'secondary' => null,
|
||||
'slate' => null,
|
||||
'gray' => null,
|
||||
'zinc' => null,
|
||||
'neutral' => null,
|
||||
'stone' => null,
|
||||
'red' => 'text-red-800',
|
||||
'orange' => null,
|
||||
'amber' => 'text-amber-800',
|
||||
'yellow' => 'text-yellow-800',
|
||||
'lime' => null,
|
||||
'green' => 'text-green-800',
|
||||
'emerald' => null,
|
||||
'teal' => null,
|
||||
'cyan' => null,
|
||||
'sky' => null,
|
||||
'blue' => null,
|
||||
'indigo' => null,
|
||||
'violet' => null,
|
||||
'purple' => null,
|
||||
'fuchsia' => null,
|
||||
'pink' => null,
|
||||
'rose' => null,
|
||||
'mauve' => null,
|
||||
'olive' => null,
|
||||
'mist' => null,
|
||||
'taupe' => null,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Bordered side colors.
|
||||
*
|
||||
* @return array<string, string|null>
|
||||
*/
|
||||
public function borderedColors(Component $component): array
|
||||
{
|
||||
return [
|
||||
'black' => null,
|
||||
'primary' => null,
|
||||
'secondary' => null,
|
||||
'slate' => null,
|
||||
'gray' => null,
|
||||
'zinc' => null,
|
||||
'neutral' => null,
|
||||
'stone' => null,
|
||||
'red' => null,
|
||||
'orange' => null,
|
||||
'amber' => null,
|
||||
'yellow' => null,
|
||||
'lime' => null,
|
||||
'green' => null,
|
||||
'emerald' => null,
|
||||
'teal' => null,
|
||||
'cyan' => null,
|
||||
'sky' => null,
|
||||
'blue' => null,
|
||||
'indigo' => null,
|
||||
'violet' => null,
|
||||
'purple' => null,
|
||||
'fuchsia' => null,
|
||||
'pink' => null,
|
||||
'rose' => null,
|
||||
'mauve' => null,
|
||||
'olive' => null,
|
||||
'mist' => null,
|
||||
'taupe' => null,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\TallStackUi\Colors;
|
||||
|
||||
use Illuminate\View\Component;
|
||||
|
||||
/**
|
||||
* TallStackUI link colours, published from the package stub. The default
|
||||
* text-primary-500 has no dark variant and is below 4.5:1 on the dark
|
||||
* background. Null keeps the package default.
|
||||
*/
|
||||
class LinkColors
|
||||
{
|
||||
/**
|
||||
* Text colors.
|
||||
*
|
||||
* @return array<string, string|null>
|
||||
*/
|
||||
public function textColors(Component $component): array
|
||||
{
|
||||
return [
|
||||
'black' => null,
|
||||
'primary' => 'text-primary-600 dark:text-primary-300',
|
||||
'secondary' => null,
|
||||
'slate' => null,
|
||||
'gray' => null,
|
||||
'zinc' => null,
|
||||
'neutral' => null,
|
||||
'stone' => null,
|
||||
'red' => null,
|
||||
'orange' => null,
|
||||
'amber' => null,
|
||||
'yellow' => null,
|
||||
'lime' => null,
|
||||
'green' => null,
|
||||
'emerald' => null,
|
||||
'teal' => null,
|
||||
'cyan' => null,
|
||||
'sky' => null,
|
||||
'blue' => null,
|
||||
'indigo' => null,
|
||||
'violet' => null,
|
||||
'purple' => null,
|
||||
'fuchsia' => null,
|
||||
'pink' => null,
|
||||
'rose' => null,
|
||||
'mauve' => null,
|
||||
'olive' => null,
|
||||
'mist' => null,
|
||||
'taupe' => null,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,6 @@
|
||||
"deploying-to-cloud",
|
||||
"laravel-best-practices",
|
||||
"testing-best-practices",
|
||||
"fluxui-development",
|
||||
"livewire-development",
|
||||
"tailwindcss-development"
|
||||
]
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@
|
||||
"php": "^8.3",
|
||||
"laravel/framework": "^13.17",
|
||||
"laravel/tinker": "^3.0",
|
||||
"livewire/flux": "^2.22",
|
||||
"livewire/livewire": "^4.4"
|
||||
"livewire/livewire": "^4.4",
|
||||
"tallstackui/tallstackui": "^4.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"fakerphp/faker": "^1.23",
|
||||
|
||||
Generated
+82
-68
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "52ac0c6347bdd6158266297dfbf8842c",
|
||||
"content-hash": "580c7495336bac049cf6ea6b355810d2",
|
||||
"packages": [
|
||||
{
|
||||
"name": "brick/math",
|
||||
@@ -2066,73 +2066,6 @@
|
||||
"time": "2026-11-04T12:45:07+00:00",
|
||||
"published-time": "2026-11-04T13:02:27+00:00"
|
||||
},
|
||||
{
|
||||
"name": "livewire/flux",
|
||||
"version": "v2.22.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/livewire/flux.git",
|
||||
"reference": "e287c445e5266ada565a2fa7a0b356bd238e4f6e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/livewire/flux/zipball/e287c445e5266ada565a2fa7a0b356bd238e4f6e",
|
||||
"reference": "e287c445e5266ada565a2fa7a0b356bd238e4f6e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"illuminate/console": "^10.0|^11.0|^12.0|^13.0",
|
||||
"illuminate/support": "^10.0|^11.0|^12.0|^13.0",
|
||||
"illuminate/view": "^10.0|^11.0|^12.0|^13.0",
|
||||
"laravel/prompts": "^0.1|^0.2|^0.3",
|
||||
"livewire/livewire": "^3.7.4|^4.0|dev-main",
|
||||
"php": "^8.1",
|
||||
"symfony/console": "^6.0|^7.0|^8.0"
|
||||
},
|
||||
"conflict": {
|
||||
"livewire/blaze": "<1.0.0-beta.2"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"aliases": {
|
||||
"Flux": "Flux\\Flux"
|
||||
},
|
||||
"providers": [
|
||||
"Flux\\FluxServiceProvider"
|
||||
]
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Flux\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"proprietary"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Caleb Porzio",
|
||||
"email": "[email protected]"
|
||||
}
|
||||
],
|
||||
"description": "The official UI component library for Livewire.",
|
||||
"keywords": [
|
||||
"components",
|
||||
"flux",
|
||||
"laravel",
|
||||
"livewire",
|
||||
"ui"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/livewire/flux/issues",
|
||||
"source": "https://github.com/livewire/flux/tree/v2.22.0"
|
||||
},
|
||||
"time": "2026-11-19T00:29:15+00:00",
|
||||
"published-time": "2026-11-19T00:58:13+00:00"
|
||||
},
|
||||
{
|
||||
"name": "livewire/livewire",
|
||||
"version": "v4.4.9",
|
||||
@@ -6135,6 +6068,87 @@
|
||||
"time": "2026-10-26T21:55:04+00:00",
|
||||
"published-time": "2026-10-28T18:25:26+00:00"
|
||||
},
|
||||
{
|
||||
"name": "tallstackui/tallstackui",
|
||||
"version": "v4.8.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/tallstackui/tallstackui.git",
|
||||
"reference": "545bcf4fef21c971ffa351acda08333ab83536dc"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/tallstackui/tallstackui/zipball/545bcf4fef21c971ffa351acda08333ab83536dc",
|
||||
"reference": "545bcf4fef21c971ffa351acda08333ab83536dc",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-zip": "*",
|
||||
"illuminate/console": "^10.0|^11.0|^12.0|^13.0",
|
||||
"illuminate/contracts": "^10.0|^11.0|^12.0|^13.0",
|
||||
"illuminate/pagination": "^10.0|^11.0|^12.0|^13.0",
|
||||
"illuminate/support": "^10.0|^11.0|^12.0|^13.0",
|
||||
"illuminate/view": "^10.0|^11.0|^12.0|^13.0",
|
||||
"livewire/livewire": "^4.3.0",
|
||||
"php": "^8.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"blade-ui-kit/blade-icons": "^1.7",
|
||||
"larastan/larastan": "^3.9",
|
||||
"laravel/pint": "^1.13",
|
||||
"orchestra/testbench": "^8.21.0|^9.0|^10.0|^11.0",
|
||||
"orchestra/testbench-dusk": "^8.24|^9.1|^10.0|^11.0",
|
||||
"pestphp/pest": "^5.0",
|
||||
"pestphp/pest-plugin-type-coverage": "^5.0",
|
||||
"spatie/ray": "^1.41"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"aliases": {
|
||||
"TallStackUi": "TallStackUi\\Facades\\TallStackUi"
|
||||
},
|
||||
"providers": [
|
||||
"TallStackUi\\TallStackUiServiceProvider"
|
||||
]
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/helpers.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"TallStackUi\\": "src/"
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"src/**/*FeatureTest.php",
|
||||
"src/**/*BrowserTest.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "AJ Meireles",
|
||||
"email": "[email protected]"
|
||||
}
|
||||
],
|
||||
"description": "TallStackUI is a powerful suite of Blade components that elevate your workflow of Livewire applications.",
|
||||
"support": {
|
||||
"issues": "https://github.com/tallstackui/tallstackui/issues",
|
||||
"source": "https://github.com/tallstackui/tallstackui/tree/v4.8.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/devajmeireles",
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2026-11-19T19:33:23+00:00",
|
||||
"published-time": "2026-11-19T19:33:45+00:00"
|
||||
},
|
||||
{
|
||||
"name": "tijsverkoyen/css-to-inline-styles",
|
||||
"version": "v2.4.0",
|
||||
|
||||
@@ -89,7 +89,7 @@ Tekniset toteutukset.
|
||||
- Myöhemmin: ulkoiset API:t (laskutusohjelma), tiedostot, sähköposti.
|
||||
|
||||
### Presentation
|
||||
Käyttöliittymä. Tässä projektissa se on **Livewire 4 single-file -komponentteja ja Flux UI:ta**, ei controllereita.
|
||||
Käyttöliittymä. Tässä projektissa se on **Livewire 4 single-file -komponentteja ja TallStackUI 4 -komponentteja**, ei controllereita.
|
||||
|
||||
- Sivut ovat `Presentation/Livewire/⚡<nimi>.blade.php` ja niihin viitataan `customers::index`-muodossa.
|
||||
- **Livewire Form -objekti** (`CustomerForm`) vastaa Form Requestia: se validoi syötteen *muodon* (pakollisuus, pituus, enum) ja rakentaa DTO:n. Liiketoimintasääntöjä (Y-tunnuksen tarkiste, yksilöllisyys) se ei toista, vaan ne tulevat Domainista.
|
||||
@@ -206,7 +206,7 @@ Esimerkki: vaiheen 1 `CustomerJobs` (asiakastyöt).
|
||||
| Määrittely | Toteutus | Syy |
|
||||
|---|---|---|
|
||||
| Laravel 12 | Laravel 13 | Projektiin asennettu versio. Periaatteet ovat samat. |
|
||||
| Controllerit, Form Requestit, API Resourcet | Livewire SFC + Livewire Form | Projektin käyttöliittymä on Livewire 4 + Flux. Controllerit tulevat API:n myötä. |
|
||||
| Controllerit, Form Requestit, API Resourcet | Livewire SFC + Livewire Form | Projektin käyttöliittymä on Livewire 4 + TallStackUI. Controllerit tulevat API:n myötä. |
|
||||
| Esimerkkimoduulit Customers, Orders, Products, Invoicing | Shared + Customers | Moduuleja ei luoda varmuuden vuoksi. Tämän yrityksen moduulit ovat `määrittely.txt`:n mukaan Customers, CustomerJobs, TimeTracking, Expenses, ServiceCatalog, Tasks ja Billing, ja ne tehdään omissa vaiheissaan. |
|
||||
| Moduulikohtaiset migraatiot | `database/migrations` | Laravelin normaalit hakemistot säilytetään. |
|
||||
| Application ei riipu Laravelista | Sallittu: `Illuminate\Contracts\Pagination` | Sivutus ilman omaa abstraktiota (ks. luku 3). |
|
||||
|
||||
@@ -11,6 +11,7 @@ return [
|
||||
'login' => 'Kirjaudu',
|
||||
'email' => 'Sähköposti',
|
||||
'password_label' => 'Salasana',
|
||||
'show_password' => 'Näytä salasana',
|
||||
'remember' => 'Muista minut tällä laitteella',
|
||||
'forgot_password' => 'Unohditko salasanan?',
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ return [
|
||||
|
||||
'new' => 'Uusi asiakas',
|
||||
'edit' => 'Muokkaa',
|
||||
'actions' => 'Toiminnot',
|
||||
'save' => 'Tallenna',
|
||||
'cancel' => 'Peruuta',
|
||||
'search' => 'Hae asiakasta',
|
||||
|
||||
@@ -7,6 +7,7 @@ return [
|
||||
|
||||
'new' => 'Uusi käyttäjä',
|
||||
'edit' => 'Muokkaa',
|
||||
'actions' => 'Toiminnot',
|
||||
'save' => 'Tallenna',
|
||||
'cancel' => 'Peruuta',
|
||||
'search' => 'Hae käyttäjää',
|
||||
|
||||
Vendored
+263
@@ -0,0 +1,263 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Finnish strings for TallStackUI's own components. The package ships no
|
||||
* Finnish translation; keys mirror vendor/tallstackui/tallstackui/lang/en.
|
||||
*/
|
||||
|
||||
return [
|
||||
'environment' => [
|
||||
'environment' => 'Ympäristö',
|
||||
'branch' => 'Haara',
|
||||
],
|
||||
|
||||
'errors' => [
|
||||
'title' => 'Lomakkeessa on :count virhettä:',
|
||||
],
|
||||
|
||||
'select' => [
|
||||
'default' => 'Valitse',
|
||||
'search' => 'Hae',
|
||||
'empty' => 'Ei tuloksia',
|
||||
'selected' => ':count valittu',
|
||||
],
|
||||
|
||||
'tag' => [
|
||||
'empty' => 'Ei tuloksia',
|
||||
],
|
||||
|
||||
'autocomplete' => [
|
||||
'default' => 'Kirjoita hakeaksesi…',
|
||||
'empty' => 'Ei tuloksia',
|
||||
],
|
||||
|
||||
'toast' => [
|
||||
'button' => [
|
||||
'ok' => 'OK',
|
||||
'confirm' => 'Vahvista',
|
||||
'cancel' => 'Peruuta',
|
||||
],
|
||||
],
|
||||
|
||||
'dialog' => [
|
||||
'button' => [
|
||||
'ok' => 'OK',
|
||||
'confirm' => 'Vahvista',
|
||||
'cancel' => 'Peruuta',
|
||||
],
|
||||
],
|
||||
|
||||
'command-palette' => [
|
||||
'search' => 'Hae…',
|
||||
'empty' => 'Ei tuloksia.',
|
||||
'navigate' => 'siirry',
|
||||
'select' => 'valitse',
|
||||
'close' => 'sulje',
|
||||
],
|
||||
|
||||
'table' => [
|
||||
'empty' => 'Ei tuloksia.',
|
||||
'quantity' => 'Määrä',
|
||||
'search' => 'Hae',
|
||||
],
|
||||
|
||||
'clipboard' => [
|
||||
'button' => [
|
||||
'copy' => 'Kopioi',
|
||||
'copied' => 'Kopioitu!',
|
||||
],
|
||||
],
|
||||
|
||||
'qr-code' => [
|
||||
'copy' => 'Kopioi',
|
||||
'download' => 'Lataa',
|
||||
],
|
||||
|
||||
'password' => [
|
||||
'rules' => [
|
||||
'title' => 'Salasanan vaatimukset:',
|
||||
'formats' => [
|
||||
'min' => 'Vähintään :min merkkiä',
|
||||
'numbers' => 'Vähintään yksi numero',
|
||||
'symbols' => 'Vähintään yksi erikoismerkki (:symbols)',
|
||||
'mixed' => 'Isoja ja pieniä kirjaimia',
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
'upload' => [
|
||||
'placeholder' => 'Valitse tiedosto',
|
||||
'size' => 'Koko',
|
||||
'upload' => 'Lataa tiedosto napsauttamalla',
|
||||
'uploaded' => [
|
||||
'single' => ':count tiedosto lähetetty',
|
||||
'multiple' => ':count tiedostoa lähetetty',
|
||||
],
|
||||
'error' => 'Jokin meni vikaan. Yritä uudelleen.',
|
||||
'static' => [
|
||||
'empty' => [
|
||||
'title' => 'Ei kuvia.',
|
||||
'description' => 'Sinulla ei ole vielä kuvia.',
|
||||
],
|
||||
],
|
||||
'invalid' => 'Tiedostossa on virhe.',
|
||||
],
|
||||
|
||||
'upload_async' => [
|
||||
'title' => 'Pudota tiedostot tähän',
|
||||
'description' => 'tai valitse napsauttamalla',
|
||||
'send' => 'Lähetä',
|
||||
'clear' => 'Tyhjennä',
|
||||
'ready' => [
|
||||
'single' => ':count tiedosto valmiina · :size',
|
||||
'multiple' => ':count tiedostoa valmiina · :size',
|
||||
],
|
||||
'errors' => [
|
||||
'mime' => 'Tiedostotyyppi ei ole sallittu.',
|
||||
'size' => 'Tiedosto ylittää :max Mt:n rajan.',
|
||||
'limit' => 'Voit ladata enintään :max tiedostoa.',
|
||||
'network' => 'Verkkovirhe. Yritä uudelleen.',
|
||||
'server' => 'Lataus epäonnistui. Yritä uudelleen.',
|
||||
'integrity' => 'Lataus jäi kesken. Yritä uudelleen.',
|
||||
'unauthorized' => 'Sinulla ei ole oikeutta ladata tätä tiedostoa.',
|
||||
'generic' => 'Jokin meni vikaan.',
|
||||
],
|
||||
],
|
||||
|
||||
'date' => [
|
||||
'calendar' => [
|
||||
'months' => [
|
||||
'january' => 'Tammikuu',
|
||||
'february' => 'Helmikuu',
|
||||
'march' => 'Maaliskuu',
|
||||
'april' => 'Huhtikuu',
|
||||
'may' => 'Toukokuu',
|
||||
'june' => 'Kesäkuu',
|
||||
'july' => 'Heinäkuu',
|
||||
'august' => 'Elokuu',
|
||||
'september' => 'Syyskuu',
|
||||
'october' => 'Lokakuu',
|
||||
'november' => 'Marraskuu',
|
||||
'december' => 'Joulukuu',
|
||||
],
|
||||
'week' => [
|
||||
'sunday' => 'Sunnuntai',
|
||||
'monday' => 'Maanantai',
|
||||
'tuesday' => 'Tiistai',
|
||||
'wednesday' => 'Keskiviikko',
|
||||
'thursday' => 'Torstai',
|
||||
'friday' => 'Perjantai',
|
||||
'saturday' => 'Lauantai',
|
||||
],
|
||||
],
|
||||
'helpers' => [
|
||||
'yesterday' => 'Eilen',
|
||||
'today' => 'Tänään',
|
||||
'tomorrow' => 'Huomenna',
|
||||
],
|
||||
],
|
||||
|
||||
'time' => [
|
||||
'helper' => 'Nykyinen aika',
|
||||
],
|
||||
|
||||
'step' => [
|
||||
'next' => 'Seuraava',
|
||||
'previous' => 'Edellinen',
|
||||
'finish' => 'Valmis',
|
||||
],
|
||||
|
||||
'key-value' => [
|
||||
'headers' => [
|
||||
'key' => 'AVAIN',
|
||||
'value' => 'ARVO',
|
||||
],
|
||||
'placeholders' => [
|
||||
'key' => 'Anna avain',
|
||||
'value' => 'Anna arvo',
|
||||
],
|
||||
'add-row' => 'LISÄÄ RIVI',
|
||||
'empty' => 'Ei rivejä.',
|
||||
],
|
||||
|
||||
'currency' => [
|
||||
'symbol' => '€',
|
||||
'currency' => 'EUR',
|
||||
],
|
||||
|
||||
'list' => [
|
||||
'search' => 'Hae',
|
||||
'empty' => 'Ei kohteita.',
|
||||
],
|
||||
|
||||
'editor' => [
|
||||
'placeholder' => 'Aloita kirjoittaminen…',
|
||||
'tooltip' => [
|
||||
'style' => 'Kappaletyyli',
|
||||
'blockquote' => 'Lainaus',
|
||||
'bold' => 'Lihavointi',
|
||||
'italic' => 'Kursivointi',
|
||||
'underline' => 'Alleviivaus',
|
||||
'strikethrough' => 'Yliviivaus',
|
||||
'ordered_list' => 'Numeroitu luettelo',
|
||||
'unordered_list' => 'Luettelo',
|
||||
'indent' => 'Suurenna sisennystä',
|
||||
'outdent' => 'Pienennä sisennystä',
|
||||
'align' => 'Tasaus',
|
||||
'code' => 'Koodi',
|
||||
'code_block' => 'Koodilohko',
|
||||
'clear_format' => 'Poista muotoilu',
|
||||
'link' => 'Lisää linkki',
|
||||
'image' => 'Lisää kuva',
|
||||
'hr' => 'Vaakaviiva',
|
||||
'undo' => 'Kumoa',
|
||||
'redo' => 'Tee uudelleen',
|
||||
'fullscreen' => 'Koko näyttö',
|
||||
],
|
||||
'style' => [
|
||||
'paragraph' => 'Kappale',
|
||||
'h1' => 'Otsikko 1',
|
||||
'h2' => 'Otsikko 2',
|
||||
'h3' => 'Otsikko 3',
|
||||
],
|
||||
'align' => [
|
||||
'left' => 'Vasen',
|
||||
'center' => 'Keskitetty',
|
||||
'right' => 'Oikea',
|
||||
'justify' => 'Tasattu',
|
||||
],
|
||||
'image' => [
|
||||
'title' => 'Lisää kuva',
|
||||
'upload' => 'Valitse tiedosto',
|
||||
'upload_hint' => 'PNG, JPG, GIF tai WebP, enintään :size',
|
||||
'or_url' => 'tai liitä osoite',
|
||||
'url' => 'Osoite',
|
||||
'alt' => 'Vaihtoehtoinen teksti',
|
||||
'alt_hint' => 'Kuvaile kuva ruudunlukijalle',
|
||||
'cancel' => 'Peruuta',
|
||||
'insert' => 'Lisää',
|
||||
'errors' => [
|
||||
'url' => 'Osoite on virheellinen tai siihen ei saada yhteyttä.',
|
||||
'mime' => 'Tiedostotyyppi ei ole sallittu.',
|
||||
'size' => 'Tiedosto ylittää :max kt:n rajan.',
|
||||
'failed' => 'Lataus epäonnistui. Yritä uudelleen.',
|
||||
],
|
||||
],
|
||||
'link' => [
|
||||
'title' => 'Lisää linkki',
|
||||
'text' => 'Teksti',
|
||||
'url' => 'Osoite',
|
||||
'cancel' => 'Peruuta',
|
||||
'insert' => 'Lisää',
|
||||
],
|
||||
'counters' => [
|
||||
'words' => ':count sana|:count sanaa',
|
||||
'lines' => ':count rivi|:count riviä',
|
||||
],
|
||||
],
|
||||
|
||||
'spinner' => [
|
||||
'thinking' => 'Mietitään…',
|
||||
'loading' => 'Ladataan…',
|
||||
],
|
||||
];
|
||||
Generated
+37
@@ -5,6 +5,7 @@
|
||||
"packages": {
|
||||
"": {
|
||||
"devDependencies": {
|
||||
"@tailwindcss/forms": "^0.5.11",
|
||||
"@tailwindcss/vite": "^4.0.0",
|
||||
"concurrently": "^10.0.3",
|
||||
"laravel-vite-plugin": "^3.1",
|
||||
@@ -435,6 +436,18 @@
|
||||
"integrity": "sha512-glFIJDvLNDtJhT9qrMFWLPbvS+skxgt4L0K8Ei2YtnhPysAJnsI7nyxSJxKj4ADeKX0OLjC4ntRkwpLOoS3rwA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@tailwindcss/forms": {
|
||||
"version": "0.5.11",
|
||||
"resolved": "https://registry.npmjs.org/@tailwindcss/forms/-/forms-0.5.11.tgz",
|
||||
"integrity": "sha512-h9wegbZDPurxG22xZSoWtdzc41/OlNEUQERNqI/0fOwa2aVlWGu7C35E/x6LDyD3lgtztFSSjKZyuVM0hxhbgA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"mini-svg-data-uri": "^1.2.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"tailwindcss": ">=3.0.0 || >= 3.0.0-alpha.1 || >= 4.0.0-alpha.20 || >= 4.0.0-beta.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@tailwindcss/node": {
|
||||
"version": "4.3.5",
|
||||
"resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.3.5.tgz",
|
||||
@@ -1531,6 +1544,15 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/mini-svg-data-uri": {
|
||||
"version": "1.4.4",
|
||||
"resolved": "https://registry.npmjs.org/mini-svg-data-uri/-/mini-svg-data-uri-1.4.4.tgz",
|
||||
"integrity": "sha512-r9deDe9p5FJUPZAk3A59wGH7Ii9YrjjWw0jmw/liSbHl2CHiyXj6FcDXDu2K3TjVAXqiJdaw3xxwlZZr9E6nHg==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"mini-svg-data-uri": "cli.js"
|
||||
}
|
||||
},
|
||||
"node_modules/nanoid": {
|
||||
"version": "3.3.20",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz",
|
||||
@@ -2401,6 +2423,15 @@
|
||||
"integrity": "sha512-glFIJDvLNDtJhT9qrMFWLPbvS+skxgt4L0K8Ei2YtnhPysAJnsI7nyxSJxKj4ADeKX0OLjC4ntRkwpLOoS3rwA==",
|
||||
"dev": true
|
||||
},
|
||||
"@tailwindcss/forms": {
|
||||
"version": "0.5.11",
|
||||
"resolved": "https://registry.npmjs.org/@tailwindcss/forms/-/forms-0.5.11.tgz",
|
||||
"integrity": "sha512-h9wegbZDPurxG22xZSoWtdzc41/OlNEUQERNqI/0fOwa2aVlWGu7C35E/x6LDyD3lgtztFSSjKZyuVM0hxhbgA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"mini-svg-data-uri": "^1.2.3"
|
||||
}
|
||||
},
|
||||
"@tailwindcss/node": {
|
||||
"version": "4.3.5",
|
||||
"resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.3.5.tgz",
|
||||
@@ -3018,6 +3049,12 @@
|
||||
"integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
|
||||
"optional": true
|
||||
},
|
||||
"mini-svg-data-uri": {
|
||||
"version": "1.4.4",
|
||||
"resolved": "https://registry.npmjs.org/mini-svg-data-uri/-/mini-svg-data-uri-1.4.4.tgz",
|
||||
"integrity": "sha512-r9deDe9p5FJUPZAk3A59wGH7Ii9YrjjWw0jmw/liSbHl2CHiyXj6FcDXDu2K3TjVAXqiJdaw3xxwlZZr9E6nHg==",
|
||||
"dev": true
|
||||
},
|
||||
"nanoid": {
|
||||
"version": "3.3.20",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz",
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
"dev": "vite"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/forms": "^0.5.11",
|
||||
"@tailwindcss/vite": "^4.0.0",
|
||||
"concurrently": "^10.0.3",
|
||||
"laravel-vite-plugin": "^3.1",
|
||||
|
||||
+15
-11
@@ -1,25 +1,29 @@
|
||||
@import 'tailwindcss';
|
||||
@import '../../vendor/livewire/flux/dist/flux.css';
|
||||
@import '../../vendor/tallstackui/tallstackui/css/v4.css';
|
||||
|
||||
@plugin '@tailwindcss/forms';
|
||||
|
||||
@source '../../vendor/tallstackui/tallstackui/**/*.php';
|
||||
@source '../views';
|
||||
@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php';
|
||||
@source '../../storage/framework/views/*.php';
|
||||
@source '../../app/Modules/**/*.blade.php';
|
||||
@source '../../app/Providers/*.php';
|
||||
@source '../../app/View/**/*.php';
|
||||
|
||||
@custom-variant dark (&:where(.dark, .dark *));
|
||||
|
||||
@theme {
|
||||
--font-sans: Inter, ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
|
||||
'Segoe UI Symbol', 'Noto Color Emoji';
|
||||
}
|
||||
|
||||
/*
|
||||
* Flux error messages use red-500, which is only 3.8:1 on white.
|
||||
* WCAG 2.2 AA needs 4.5:1 for text, so use darker red in light mode.
|
||||
/*
|
||||
* TallStackUI's primary is indigo with solid buttons on primary-500, which
|
||||
* is only 4.0:1 with their light text. WCAG 2.2 AA needs 4.5:1, so the
|
||||
* shades from 500 up are moved one step darker.
|
||||
*/
|
||||
[data-flux-error] {
|
||||
color: var(--color-red-700);
|
||||
}
|
||||
|
||||
.dark [data-flux-error] {
|
||||
color: var(--color-red-400);
|
||||
--color-primary-500: #4f46e5;
|
||||
--color-primary-600: #4338ca;
|
||||
--color-primary-700: #3730a3;
|
||||
--color-primary-800: #312e81;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
{{--
|
||||
Password input with an accessible show/hide button.
|
||||
|
||||
Not <x-password />: TallStackUI's reveal button has no accessible name
|
||||
(WCAG 4.1.2), and soft customization cannot add one. The button keeps the
|
||||
stable name "Näytä salasana"; aria-pressed tells whether it is shown.
|
||||
--}}
|
||||
@props([
|
||||
'label',
|
||||
'hint' => null,
|
||||
])
|
||||
|
||||
<div x-data="{ shown: false }">
|
||||
<x-input
|
||||
:attributes="$attributes"
|
||||
:label="$label"
|
||||
:hint="$hint"
|
||||
type="password"
|
||||
x-bind:type="shown ? 'text' : 'password'"
|
||||
>
|
||||
<x-slot:suffix>
|
||||
<button
|
||||
type="button"
|
||||
x-on:click="shown = ! shown"
|
||||
x-bind:aria-pressed="shown ? 'true' : 'false'"
|
||||
aria-label="{{ __('auth.show_password') }}"
|
||||
class="flex size-8 items-center justify-center rounded-md text-zinc-600 hover:text-zinc-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-700 dark:text-zinc-300 dark:hover:text-white"
|
||||
>
|
||||
<x-icon name="eye" class="size-5" x-show="! shown" aria-hidden="true" />
|
||||
<x-icon name="eye-slash" class="size-5" x-show="shown" x-cloak aria-hidden="true" />
|
||||
</button>
|
||||
</x-slot:suffix>
|
||||
</x-input>
|
||||
</div>
|
||||
@@ -1,20 +1,37 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
<html
|
||||
lang="{{ str_replace('_', '-', app()->getLocale()) }}"
|
||||
x-data="tallstackui_darkTheme({ default: 'system' })"
|
||||
x-bind:class="{ 'dark': darkTheme }"
|
||||
>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>{{ $title ?? config('app.name') }}</title>
|
||||
|
||||
{{--
|
||||
Apply the stored theme before the first paint. TallStackUI's
|
||||
tallstackui_darkTheme() keeps it in localStorage ("dark-theme"),
|
||||
but only runs once Alpine starts, which would flash the light theme.
|
||||
--}}
|
||||
<script>
|
||||
(() => {
|
||||
const stored = localStorage.getItem('dark-theme');
|
||||
const dark = stored === 'dark' || stored === 'true'
|
||||
|| ((stored === null || stored === 'system') && window.matchMedia('(prefers-color-scheme: dark)').matches);
|
||||
document.documentElement.classList.toggle('dark', dark);
|
||||
})();
|
||||
</script>
|
||||
|
||||
<link rel="preconnect" href="https://fonts.bunny.net">
|
||||
<link href="https://fonts.bunny.net/css?family=inter:400,500,600&display=swap" rel="stylesheet" />
|
||||
|
||||
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
||||
|
||||
@include('partials.tallstackui-script')
|
||||
@livewireStyles
|
||||
@fluxAppearance
|
||||
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
||||
</head>
|
||||
<body class="min-h-screen bg-white antialiased dark:bg-zinc-800">
|
||||
<body class="min-h-screen bg-white text-zinc-900 antialiased dark:bg-zinc-800 dark:text-zinc-100">
|
||||
<a
|
||||
href="#main-content"
|
||||
class="sr-only focus:not-sr-only focus:fixed focus:start-4 focus:top-4 focus:z-50 focus:rounded-md focus:bg-white focus:px-4 focus:py-2 focus:text-zinc-900 focus:shadow-lg focus:outline-2 focus:outline-offset-2 focus:outline-blue-700"
|
||||
@@ -25,32 +42,26 @@
|
||||
@auth
|
||||
<header class="border-b border-zinc-200 dark:border-zinc-700">
|
||||
<div class="mx-auto flex max-w-5xl flex-wrap items-center gap-x-6 gap-y-2 px-4 py-3 sm:px-6">
|
||||
<flux:link :href="route('home')" wire:navigate variant="subtle" class="font-semibold">
|
||||
<a href="{{ route('home') }}" wire:navigate class="rounded font-semibold text-zinc-700 hover:text-zinc-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-700 dark:text-zinc-200 dark:hover:text-white">
|
||||
{{ config('app.name') }}
|
||||
</flux:link>
|
||||
</a>
|
||||
|
||||
<flux:navbar :aria-label="__('layout.main_menu')" class="flex-1 py-0">
|
||||
<flux:navbar.item :href="route('customers.index')" :current="request()->routeIs('customers.*')" wire:navigate>
|
||||
{{ __('layout.customers') }}
|
||||
</flux:navbar.item>
|
||||
<nav aria-label="{{ __('layout.main_menu') }}" class="flex flex-1 flex-wrap items-center gap-1">
|
||||
@include('partials.nav-item', ['route' => 'customers.index', 'pattern' => 'customers.*', 'label' => __('layout.customers')])
|
||||
|
||||
@can('users.manage')
|
||||
<flux:navbar.item :href="route('users.index')" :current="request()->routeIs('users.*')" wire:navigate>
|
||||
{{ __('layout.users') }}
|
||||
</flux:navbar.item>
|
||||
@include('partials.nav-item', ['route' => 'users.index', 'pattern' => 'users.*', 'label' => __('layout.users')])
|
||||
@endcan
|
||||
</flux:navbar>
|
||||
</nav>
|
||||
|
||||
<div class="flex flex-wrap items-center gap-3">
|
||||
<flux:text size="sm">{{ __('layout.signed_in_as', ['name' => auth()->user()->name]) }}</flux:text>
|
||||
<span class="text-sm text-zinc-600 dark:text-zinc-300">{{ __('layout.signed_in_as', ['name' => auth()->user()->name]) }}</span>
|
||||
|
||||
@include('partials.theme-toggle')
|
||||
|
||||
<form method="POST" action="{{ route('logout') }}">
|
||||
@csrf
|
||||
<flux:button type="submit" variant="ghost" size="sm" icon="arrow-right-start-on-rectangle">
|
||||
{{ __('layout.logout') }}
|
||||
</flux:button>
|
||||
<x-button submit subtle color="black" sm icon="arrow-right-start-on-rectangle" :text="__('layout.logout')" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -66,6 +77,5 @@
|
||||
</main>
|
||||
|
||||
@livewireScripts
|
||||
@fluxScripts
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -15,15 +15,13 @@ new #[Title('Toiminnanohjaus')] class extends Component
|
||||
?>
|
||||
|
||||
<div class="mx-auto max-w-xl space-y-6 p-6">
|
||||
<flux:heading size="xl" level="1">Toiminnanohjaus</flux:heading>
|
||||
<h1 class="text-2xl font-semibold">Toiminnanohjaus</h1>
|
||||
|
||||
<flux:text>Livewire ja Flux UI toimivat. Tämä on väliaikainen kokeilusivu.</flux:text>
|
||||
<p class="text-sm text-zinc-600 dark:text-zinc-300">Livewire ja TallStackUI toimivat. Tämä on väliaikainen kokeilusivu.</p>
|
||||
|
||||
<flux:button variant="primary" icon="plus" wire:click="incrementClickCount">
|
||||
Lisää klikkaus
|
||||
</flux:button>
|
||||
<x-button icon="plus" wire:click="incrementClickCount" text="Lisää klikkaus" />
|
||||
|
||||
<flux:text role="status" aria-live="polite" aria-atomic="true">
|
||||
<p role="status" aria-live="polite" aria-atomic="true" class="text-sm">
|
||||
Klikattu {{ $clickCount }} kertaa
|
||||
</flux:text>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
{{-- Main menu link. The current page is marked with aria-current and an underline, not colour alone. --}}
|
||||
@php($current = request()->routeIs($pattern))
|
||||
|
||||
<a
|
||||
href="{{ route($route) }}"
|
||||
wire:navigate
|
||||
@if ($current) aria-current="page" @endif
|
||||
@class([
|
||||
'rounded-md px-3 py-2 text-sm font-medium focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-700',
|
||||
'text-zinc-900 underline decoration-2 underline-offset-8 dark:text-white' => $current,
|
||||
'text-zinc-600 hover:bg-zinc-100 hover:text-zinc-900 dark:text-zinc-300 dark:hover:bg-zinc-700 dark:hover:text-white' => ! $current,
|
||||
])
|
||||
>
|
||||
{{ $label }}
|
||||
</a>
|
||||
@@ -0,0 +1,11 @@
|
||||
{{--
|
||||
TallStackUI's <tallstackui:script /> writes root-relative URLs
|
||||
("/tallstackui/script/..."), which 404 when the app runs in a subfolder,
|
||||
as it does locally under XAMPP (/toiminnanohjaus/public). Prefix them with
|
||||
the app's own URL so the assets load in both setups.
|
||||
--}}
|
||||
{!! str_replace(
|
||||
['"/tallstackui/script/', '"/tallstackui/style/'],
|
||||
['"'.url('tallstackui/script').'/', '"'.url('tallstackui/style').'/'],
|
||||
\TallStackUi\Facades\TallStackUi::directives()->script(),
|
||||
) !!}
|
||||
@@ -1,19 +1,21 @@
|
||||
{{--
|
||||
Light/dark theme toggle. Flux stores the choice in localStorage
|
||||
("flux.appearance") and @fluxAppearance applies it before the page paints.
|
||||
Light/dark theme toggle. It drives the tallstackui_darkTheme() state on
|
||||
<html>, which stores the choice in localStorage ("dark-theme"); the
|
||||
inline script in the layout applies it before the first paint.
|
||||
|
||||
Not <x-theme-switch />: its role="switch" button has no accessible name.
|
||||
The name stays "Tumma teema"; aria-pressed tells whether it is on.
|
||||
--}}
|
||||
<flux:button
|
||||
x-data
|
||||
x-on:click="$flux.dark = ! $flux.dark"
|
||||
x-bind:aria-pressed="$flux.dark ? 'true' : 'false'"
|
||||
<x-button.circle
|
||||
x-on:click="mode = darkTheme ? 'light' : 'dark'"
|
||||
x-bind:aria-pressed="darkTheme ? 'true' : 'false'"
|
||||
aria-label="{{ __('layout.theme_toggle') }}"
|
||||
:tooltip="__('layout.theme_toggle')"
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
square
|
||||
color="black"
|
||||
subtle
|
||||
sm
|
||||
data-theme-toggle
|
||||
>
|
||||
<flux:icon.moon variant="mini" class="dark:hidden" aria-hidden="true" />
|
||||
<flux:icon.sun variant="mini" class="hidden dark:block" aria-hidden="true" />
|
||||
</flux:button>
|
||||
<x-icon name="moon" class="size-5 dark:hidden" aria-hidden="true" />
|
||||
<x-icon name="sun" class="hidden size-5 dark:block" aria-hidden="true" />
|
||||
</x-button.circle>
|
||||
|
||||
@@ -17,14 +17,14 @@ it('switches to the dark theme and back, and remembers the choice', function ()
|
||||
->assertScript('document.documentElement.classList.contains("dark")', true)
|
||||
->assertAttribute(THEME_TOGGLE, 'aria-pressed', 'true')
|
||||
->assertAttribute(THEME_TOGGLE, 'aria-label', 'Tumma teema')
|
||||
->assertScript('localStorage.getItem("flux.appearance")', 'dark')
|
||||
->assertScript('localStorage.getItem("dark-theme")', 'dark')
|
||||
->assertNoAccessibilityIssues(level: 2);
|
||||
|
||||
$page->navigate(route('password.request'))
|
||||
->assertScript('document.documentElement.classList.contains("dark")', true)
|
||||
->click(THEME_TOGGLE)
|
||||
->assertScript('document.documentElement.classList.contains("dark")', false)
|
||||
->assertScript('localStorage.getItem("flux.appearance")', 'light')
|
||||
->assertScript('localStorage.getItem("dark-theme")', 'light')
|
||||
->assertNoAccessibilityIssues(level: 2);
|
||||
});
|
||||
|
||||
@@ -34,7 +34,7 @@ it('overrides a dark system theme', function () {
|
||||
->assertAttribute(THEME_TOGGLE, 'aria-pressed', 'true')
|
||||
->click(THEME_TOGGLE)
|
||||
->assertScript('document.documentElement.classList.contains("dark")', false)
|
||||
->assertScript('localStorage.getItem("flux.appearance")', 'light');
|
||||
->assertScript('localStorage.getItem("dark-theme")', 'light');
|
||||
});
|
||||
|
||||
it('is in the header for signed-in users and works with the keyboard', function () {
|
||||
@@ -44,5 +44,5 @@ it('is in the header for signed-in users and works with the keyboard', function
|
||||
->assertPresent('header '.THEME_TOGGLE)
|
||||
->keys(THEME_TOGGLE, 'Enter')
|
||||
->assertScript('document.documentElement.classList.contains("dark")', true)
|
||||
->assertScript('localStorage.getItem("flux.appearance")', 'dark');
|
||||
->assertScript('localStorage.getItem("dark-theme")', 'dark');
|
||||
});
|
||||
|
||||
@@ -80,6 +80,18 @@ it('sends a user who is deactivated mid-session to the login page with the reaso
|
||||
->assertNoAccessibilityIssues(level: 2);
|
||||
});
|
||||
|
||||
it('shows and hides the password with a named toggle button', function () {
|
||||
$toggle = '[aria-label="Näytä salasana"]';
|
||||
|
||||
visit(route('login'))
|
||||
->assertAttribute('[wire\\:model="password"]', 'type', 'password')
|
||||
->assertAttribute($toggle, 'aria-pressed', 'false')
|
||||
->click($toggle)
|
||||
->assertAttribute('[wire\\:model="password"]', 'type', 'text')
|
||||
->assertAttribute($toggle, 'aria-pressed', 'true')
|
||||
->assertAttribute($toggle, 'aria-label', 'Näytä salasana');
|
||||
});
|
||||
|
||||
it('logs in with the keyboard alone', function () {
|
||||
User::factory()->create(['email' => '[email protected]']);
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\URL;
|
||||
|
||||
it('loads the TallStackUI scripts from the app URL, also when the app is in a subfolder', function () {
|
||||
URL::forceRootUrl('http://localhost:8080/toiminnanohjaus/public');
|
||||
|
||||
$html = view('partials.tallstackui-script')->render();
|
||||
|
||||
expect($html)->toContain('src="http://localhost:8080/toiminnanohjaus/public/tallstackui/script/')
|
||||
->not->toContain('"/tallstackui/');
|
||||
});
|
||||
Reference in New Issue
Block a user