- Badges: the venue's list (setting signage.badges: names el/en, colours, an icon from a food and drink set) edited under Signage -> "Message & settings"; sent with the venue to screens and previews; several badges per product (MenuList.badges lists, a single one still read) in the shared multiple Dropdown; a board's badge colour / text colour override them (None = each own). - Widgets: colour, background plate, font, bold / italic / underline, text size, QR colours; widgets in a stack's part get every setting, vertical alignment, and a custom box inside their place, picked (stack, then widget) and dragged on the preview (selection by path "2.1.0"). - Menu slides: vertical alignment of the list (board_valign); "Where the list sits" is now "Horizontal alignment". - Message of the day: one component in the settings tab, on the Overview and from its widget. - Leaving a slide with changes: "Save and leave" (ConfirmDialog altLabel). - @xenia/ui: ColourField (with colour.js helpers), FieldRow (framed only while wrapped), Slider, IconPicker, Segmented multiple; native selects on the Overview and signage replaced by Dropdown, the device settings' colour input by ColourField. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
16 lines
739 B
JavaScript
16 lines
739 B
JavaScript
import assert from 'node:assert/strict'
|
|
import { test } from 'node:test'
|
|
import { COLOUR_PRESETS, joinAlpha, splitAlpha, typedColour } from '../src/components/colour.js'
|
|
|
|
test('a colour with its opacity: #rrggbbaa, typed by hand', () => {
|
|
assert.equal(COLOUR_PRESETS.length, 12)
|
|
assert.deepEqual(splitAlpha('#FF0000'), { rgb: '#ff0000', alpha: 100 })
|
|
assert.deepEqual(splitAlpha('#ff000080'), { rgb: '#ff0000', alpha: 50 })
|
|
assert.equal(joinAlpha('#ff0000', 100), '#ff0000')
|
|
assert.equal(joinAlpha('#ff0000', 50), '#ff000080')
|
|
assert.equal(joinAlpha('#ff0000', 0), '#ff000000')
|
|
assert.equal(typedColour('abc'), '#aabbcc')
|
|
assert.equal(typedColour(' #11223344 '), '#11223344')
|
|
assert.equal(typedColour('#12345'), null)
|
|
})
|