Skip to content

Commit

Permalink
Merge branch 'main' into zp/pilliconcx
Browse files Browse the repository at this point in the history
  • Loading branch information
zaporter-work committed Nov 1, 2024
2 parents c12224f + 7a0dfa9 commit a4b641e
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@viamrobotics/prime-core",
"version": "0.0.161",
"version": "0.0.165",
"repository": {
"type": "git",
"url": "https://github.com/viamrobotics/prime.git",
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/lib/__tests__/toggle-button.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ describe('ToggleButtons', () => {
expect(onInput).not.toHaveBeenCalled();
});

it('Renders the legend correctly', () => {
it('Renders the label correctly', () => {
render(ToggleButtons, common);
expect(screen.getByText('Test toggle buttons')).toBeVisible();
});

it('Renders the legend correctly when disabled', () => {
it('Renders the label correctly when disabled', () => {
render(ToggleButtons, { ...common, disabled: true });

const legend = screen.getByText('Test toggle buttons');
expect(legend).toHaveClass('text-disabled-dark cursor-not-allowed');
const label = screen.getByText('Test toggle buttons');
expect(label).toHaveClass('text-disabled-dark cursor-not-allowed');
});
});
6 changes: 3 additions & 3 deletions packages/core/src/lib/__tests__/toggle-buttons.spec.svelte
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<script lang="ts">
import ToggleButtons from '$lib/toggle-buttons.svelte';
import ToggleButton from '$lib/toggle-button.svelte';
export let options: string[];
export let selected: string | undefined = undefined;
export let disabled = false;
</script>

<ToggleButtons
<ToggleButton
{options}
{selected}
{disabled}
on:input
>
<svelte:fragment slot="legend">Test toggle buttons</svelte:fragment>
</ToggleButtons>
</ToggleButton>
2 changes: 2 additions & 0 deletions packages/core/src/lib/icon/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const paths = {
'arrow-left': MDI.mdiArrowLeft,
'arrow-right': MDI.mdiArrowRight,
'arrow-top-right-bottom-left': MDI.mdiArrowTopRightBottomLeft,
'arrow-collapse': MDI.mdiArrowCollapse,
'arrow-up': MDI.mdiArrowUp,
article: MDI.mdiTextBoxOutline,
'axis-arrow': MDI.mdiAxisArrow,
Expand Down Expand Up @@ -126,6 +127,7 @@ export const paths = {
'robot-outline': MDI.mdiRobotOutline,
'script-text-outline': MDI.mdiScriptTextOutline,
'selection-ellipse': MDI.mdiSelectionEllipse,
'selection-drag': MDI.mdiSelectionDrag,
send: MDI.mdiSend,
'shield-key-outline': MDI.mdiShieldKeyOutline,
'stop-circle-outline': MDI.mdiStopCircleOutline,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export { default as TableRow } from './table/table-row.svelte';
export { default as TableCell } from './table/table-cell.svelte';
export { default as TabsBar } from './tabs-bar.svelte';
export { default as Tab } from './tab.svelte';
export { default as ToggleButtons } from './toggle-buttons.svelte';
export { default as ToggleButtons } from './toggle-button.svelte';

export {
Tooltip,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ $: pageIsVisible.set(visibilityState === 'visible');
<div
role="alert"
aria-label="Notifications"
class="pointer-events-none fixed bottom-auto left-auto right-0 top-6 m-0 p-0 sm:right-6"
class="pointer-events-none fixed bottom-auto left-auto right-0 top-6 z-max m-0 p-0 sm:right-6"
>
<ul>
{#each $notifications as { id, pause, resume, ...notification } (id)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ const handleClick = (value: string) => {
};
</script>

<fieldset
<div
aria-disabled={disabled ? true : undefined}
class={cx('flex', extraClasses)}
{...$$restProps}
>
{#if $$slots.legend}
<legend
<label
class={cx(
cx('mb-1 flex text-xs', {
'text-subtle-1': !disabled,
Expand All @@ -70,17 +70,17 @@ const handleClick = (value: string) => {
)}
>
<slot name="legend" />
</legend>
</label>
{/if}

<div class="flex w-full flex-nowrap">
<div class="flex w-fit flex-nowrap">
{#each options as option}
<button
type="button"
aria-pressed={isSelected(option)}
aria-disabled={disabled ? true : undefined}
class={cx(
'h-7.5 w-full whitespace-nowrap border px-3 py-1.5 text-xs',
'h-7.5 whitespace-nowrap border px-3 py-1.5 text-xs',
getButtonClasses(option)
)}
on:click={() => handleClick(option)}
Expand All @@ -90,4 +90,4 @@ const handleClick = (value: string) => {
</button>
{/each}
</div>
</fieldset>
</div>

0 comments on commit a4b641e

Please sign in to comment.